Skip to content

Commit 8416739

Browse files
committed
made saved user auth remember original class if it gets re-used
1 parent a7905c9 commit 8416739

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

openid-connect-common/src/main/java/org/mitre/oauth2/model/SavedUserAuthentication.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,13 @@ public SavedUserAuthentication(Authentication src) {
6767
setName(src.getName());
6868
setAuthorities(src.getAuthorities());
6969
setAuthenticated(src.isAuthenticated());
70-
setSourceClass(src.getClass().getName());
70+
71+
if (src instanceof SavedUserAuthentication) {
72+
// if we're copying in a saved auth, carry over the original class name
73+
setSourceClass(((SavedUserAuthentication) src).getSourceClass());
74+
} else {
75+
setSourceClass(src.getClass().getName());
76+
}
7177
}
7278

7379
/**

0 commit comments

Comments
 (0)