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 Details

    • CustomOAuth2User

      public CustomOAuth2User(Collection<? extends org.springframework.security.core.GrantedAuthority> authorities, Map<String,Object> attributes, String nameAttributeKey)
      Constructs a CustomOAuth2User using the provided parameters.
      Parameters:
      authorities - the authorities granted to the user
      attributes - the attributes about the user
      nameAttributeKey - the key used to access the user's "name" from getAttributes()
  • Method Details

    • getName

      public String getName()
      Specified by:
      getName in interface org.springframework.security.core.AuthenticatedPrincipal
    • getAuthorities

      public Collection<? extends org.springframework.security.core.GrantedAuthority> getAuthorities()
      Specified by:
      getAuthorities in interface org.springframework.security.oauth2.core.OAuth2AuthenticatedPrincipal
    • getAttributes

      public Map<String,Object> getAttributes()
      Specified by:
      getAttributes in interface org.springframework.security.oauth2.core.OAuth2AuthenticatedPrincipal
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object