1
0
mirror of synced 2026-05-22 21:33:16 +00:00

Authentication adds FactorGrantedAuthority

Closes gh-18001
This commit is contained in:
Rob Winch
2025-10-02 09:33:13 -05:00
parent ce36fc1e76
commit 3f74991ce9
9 changed files with 20 additions and 22 deletions
@@ -41,7 +41,7 @@ import org.springframework.security.core.AuthenticationException;
import org.springframework.security.core.GrantedAuthorities;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.SpringSecurityMessageSource;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.authority.FactorGrantedAuthority;
import org.springframework.security.core.authority.mapping.GrantedAuthoritiesMapper;
import org.springframework.security.core.authority.mapping.NullAuthoritiesMapper;
import org.springframework.security.core.userdetails.AuthenticationUserDetailsService;
@@ -151,7 +151,7 @@ public class CasAuthenticationProvider implements AuthenticationProvider, Initia
this.userDetailsChecker.check(userDetails);
Collection<GrantedAuthority> authorities = new ArrayList<>(
this.authoritiesMapper.mapAuthorities(userDetails.getAuthorities()));
authorities.add(new SimpleGrantedAuthority(AUTHORITY));
authorities.add(FactorGrantedAuthority.fromAuthority(AUTHORITY));
return new CasAuthenticationToken(this.key, userDetails, credentials, authorities, userDetails, assertion);
}
catch (TicketValidationException ex) {