Merge pull request #44 from dBucik/fix_acrs

fix: 🐛 Fixed missing ACRs code and device_code flows
pull/1580/head
Dominik František Bučík 2021-11-19 18:23:55 +01:00 committed by GitHub
commit 301cd03190
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -66,7 +66,9 @@ public class SavedUserAuthentication implements Authentication {
setName(src.getName());
setAuthorities(new HashSet<>(src.getAuthorities()));
setAuthenticated(src.isAuthenticated());
if (src instanceof ExpiringUsernameAuthenticationToken) {
if (src instanceof SavedUserAuthentication) {
this.setAcr(((SavedUserAuthentication) src).getAcr());
} else if (src instanceof ExpiringUsernameAuthenticationToken) {
ExpiringUsernameAuthenticationToken token = (ExpiringUsernameAuthenticationToken) src;
this.acr = ((SamlPrincipal) token.getPrincipal()).getSamlCredential()
.getAuthenticationAssertion()