/** * Creates the final <tt>UserDetails</tt> object. Can be overridden to customize the contents. * * @param token the authentication request token * @param authorities the pre-authenticated authorities. */ protected UserDetails createuserDetails(Authentication token, Collection<? extends GrantedAuthority> authorities, ClaimCollection claims) { return new FederationUser(token.getName(), "N/A", authorities, claims); } }
/** * Creates the final <tt>UserDetails</tt> object. Can be overridden to customize the contents. * * @param token the authentication request token * @param authorities the pre-authenticated authorities. */ protected UserDetails createuserDetails(Authentication token, Collection<? extends GrantedAuthority> authorities, ClaimCollection claims) { return new FederationUser(token.getName(), "N/A", authorities, claims); } }
/** * Creates the final <tt>UserDetails</tt> object. Can be overridden to customize the contents. * * @param token the authentication request token * @param authorities the pre-authenticated authorities. */ protected UserDetails createuserDetails(Authentication token, GrantedAuthority[] authorities, ClaimCollection claims) { return new FederationUser(token.getName(), "N/A", authorities, claims); }
@Override protected UserDetails loadUserDetails(FedizResponse response) { final List<GrantedAuthority> grantedAuthorities = new ArrayList<>(); if (response.getRoles() != null) { for (final String role : response.getRoles()) { grantedAuthorities.add(new SimpleGrantedAuthority("ROLE_" + (this.convertToUpperCase ? role.toUpperCase() : role))); } } return new FederationUser(response.getUsername(), "N/A", grantedAuthorities, new ClaimCollection(response.getClaims())); }
@Override protected UserDetails loadUserDetails(FedizResponse response) { final List<GrantedAuthority> grantedAuthorities = new ArrayList<>(); if (response.getRoles() != null) { for (final String role : response.getRoles()) { grantedAuthorities.add(new SimpleGrantedAuthority("ROLE_" + (this.convertToUpperCase ? role.toUpperCase() : role))); } } return new FederationUser(response.getUsername(), "N/A", grantedAuthorities, new ClaimCollection(response.getClaims())); }
@Override protected UserDetails loadUserDetails(FedizResponse response) { List<GrantedAuthority> grantedAuthorities = new ArrayList<>(); if (response.getRoles() != null) { for (final String role : response.getRoles()) { grantedAuthorities.add(new GrantedAuthorityImpl("ROLE_" + (this.convertToUpperCase ? role.toUpperCase() : role))); } } return new FederationUser(response.getUsername(), "N/A", (GrantedAuthority[]) grantedAuthorities.toArray( new GrantedAuthority[grantedAuthorities.size()]), new ClaimCollection(response.getClaims())); }