Class DefaultOAuth2AuthenticatedPrincipal

  • All Implemented Interfaces:
    java.io.Serializable, org.springframework.security.core.AuthenticatedPrincipal, OAuth2AuthenticatedPrincipal

    public final class DefaultOAuth2AuthenticatedPrincipal
    extends java.lang.Object
    implements OAuth2AuthenticatedPrincipal, java.io.Serializable
    A domain object that wraps the attributes of an OAuth 2.0 token.
    Since:
    5.2
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      DefaultOAuth2AuthenticatedPrincipal​(java.lang.String name, java.util.Map<java.lang.String,​java.lang.Object> attributes, java.util.Collection<org.springframework.security.core.GrantedAuthority> authorities)
      Constructs an DefaultOAuth2AuthenticatedPrincipal using the provided parameters.
      DefaultOAuth2AuthenticatedPrincipal​(java.util.Map<java.lang.String,​java.lang.Object> attributes, java.util.Collection<org.springframework.security.core.GrantedAuthority> authorities)
      Constructs an DefaultOAuth2AuthenticatedPrincipal using the provided parameters.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Map<java.lang.String,​java.lang.Object> getAttributes()
      Gets the attributes of the OAuth 2.0 token in map form.
      java.util.Collection<? extends org.springframework.security.core.GrantedAuthority> getAuthorities()
      Get the Collection of GrantedAuthoritys associated with this OAuth 2.0 token
      java.lang.String getName()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultOAuth2AuthenticatedPrincipal

        public DefaultOAuth2AuthenticatedPrincipal​(java.util.Map<java.lang.String,​java.lang.Object> attributes,
                                                   java.util.Collection<org.springframework.security.core.GrantedAuthority> authorities)
        Constructs an DefaultOAuth2AuthenticatedPrincipal using the provided parameters.
        Parameters:
        attributes - the attributes of the OAuth 2.0 token
        authorities - the authorities of the OAuth 2.0 token
      • DefaultOAuth2AuthenticatedPrincipal

        public DefaultOAuth2AuthenticatedPrincipal​(java.lang.String name,
                                                   java.util.Map<java.lang.String,​java.lang.Object> attributes,
                                                   java.util.Collection<org.springframework.security.core.GrantedAuthority> authorities)
        Constructs an DefaultOAuth2AuthenticatedPrincipal using the provided parameters.
        Parameters:
        name - the name attached to the OAuth 2.0 token
        attributes - the attributes of the OAuth 2.0 token
        authorities - the authorities of the OAuth 2.0 token
    • Method Detail

      • getAttributes

        public java.util.Map<java.lang.String,​java.lang.Object> getAttributes()
        Gets the attributes of the OAuth 2.0 token in map form.
        Specified by:
        getAttributes in interface OAuth2AuthenticatedPrincipal
        Returns:
        a Map of the attribute's objects keyed by the attribute's names
      • getAuthorities

        public java.util.Collection<? extends org.springframework.security.core.GrantedAuthority> getAuthorities()
        Description copied from interface: OAuth2AuthenticatedPrincipal
        Get the Collection of GrantedAuthoritys associated with this OAuth 2.0 token
        Specified by:
        getAuthorities in interface OAuth2AuthenticatedPrincipal
        Returns:
        the OAuth 2.0 token authorities
      • getName

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