This repository was archived by the owner on Sep 28, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
perun-oidc-server/src/main/java/cz/muni/ics/oauth2/model Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -100,17 +100,21 @@ public SavedUserAuthentication(Authentication src) {
100
100
setAuthorities (new HashSet <>(src .getAuthorities ()));
101
101
setAuthenticated (src .isAuthenticated ());
102
102
if (src instanceof SavedUserAuthentication ) {
103
- this .setAcr (((SavedUserAuthentication ) src ).getAcr ());
103
+ SavedUserAuthentication source = (SavedUserAuthentication ) src ;
104
+ this .setAcr (source .getAcr ());
105
+ this .setAuthenticationDetails (source .getAuthenticationDetails ());
104
106
} else if (src instanceof ExpiringUsernameAuthenticationToken ) {
105
107
ExpiringUsernameAuthenticationToken token = (ExpiringUsernameAuthenticationToken ) src ;
106
- this .acr = ((SamlPrincipal ) token .getPrincipal ()).getSamlCredential ()
108
+ SAMLCredential credential = ((SamlPrincipal ) token .getPrincipal ()).getSamlCredential ();
109
+ this .setAcr (credential
107
110
.getAuthenticationAssertion ()
108
111
.getAuthnStatements ().stream ()
109
112
.map (AuthnStatement ::getAuthnContext )
110
113
.map (AuthnContext ::getAuthnContextClassRef )
111
114
.map (AuthnContextClassRef ::getAuthnContextClassRef )
112
- .collect (Collectors .joining ());
113
- this .authenticationDetails = new SamlAuthenticationDetails ((SAMLCredential ) src .getCredentials ());
115
+ .collect (Collectors .joining ())
116
+ );
117
+ this .setAuthenticationDetails (new SamlAuthenticationDetails (credential ));
114
118
}
115
119
}
116
120
You can’t perform that action at this time.
0 commit comments