Class CustomOAuth2User
java.lang.Object
com.xebialabs.platform.sso.oidc.user.CustomOAuth2User
- All Implemented Interfaces:
Serializable,org.springframework.security.core.AuthenticatedPrincipal,org.springframework.security.oauth2.core.OAuth2AuthenticatedPrincipal,org.springframework.security.oauth2.core.user.OAuth2User
- Direct Known Subclasses:
CustomOidcUser
public class CustomOAuth2User
extends Object
implements org.springframework.security.oauth2.core.user.OAuth2User, Serializable
Custom class which is replica of the
DefaultOAuth2User
Once https://github.com/spring-projects/spring-security/issues/9366 is addressed, this class can be removed.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCustomOAuth2User(Collection<? extends org.springframework.security.core.GrantedAuthority> authorities, Map<String, Object> attributes, String nameAttributeKey) Constructs aCustomOAuth2Userusing the provided parameters. -
Method Summary
Modifier and TypeMethodDescriptionbooleanCollection<? extends org.springframework.security.core.GrantedAuthority> getName()inthashCode()toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.security.oauth2.core.OAuth2AuthenticatedPrincipal
getAttribute
-
Constructor Details
-
CustomOAuth2User
public CustomOAuth2User(Collection<? extends org.springframework.security.core.GrantedAuthority> authorities, Map<String, Object> attributes, String nameAttributeKey) Constructs aCustomOAuth2Userusing the provided parameters.- Parameters:
authorities- the authorities granted to the userattributes- the attributes about the usernameAttributeKey- the key used to access the user's "name" fromgetAttributes()
-
-
Method Details
-
getName
- Specified by:
getNamein interfaceorg.springframework.security.core.AuthenticatedPrincipal
-
getAuthorities
- Specified by:
getAuthoritiesin interfaceorg.springframework.security.oauth2.core.OAuth2AuthenticatedPrincipal
-
getAttributes
- Specified by:
getAttributesin interfaceorg.springframework.security.oauth2.core.OAuth2AuthenticatedPrincipal
-
equals
-
hashCode
public int hashCode() -
toString
-