Class DefaultOAuth2User

    • Constructor Summary

      Constructors 
      Constructor Description
      DefaultOAuth2User​(java.util.Collection<? extends GrantedAuthority> authorities, java.util.Map<java.lang.String,​java.lang.Object> attributes, java.lang.String nameAttributeKey)
      Constructs a DefaultOAuth2User using the provided parameters.
    • Constructor Detail

      • DefaultOAuth2User

        public DefaultOAuth2User​(java.util.Collection<? extends GrantedAuthority> authorities,
                                 java.util.Map<java.lang.String,​java.lang.Object> attributes,
                                 java.lang.String nameAttributeKey)
        Constructs a DefaultOAuth2User 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 Detail

      • getName

        public java.lang.String getName()
        Description copied from interface: AuthenticatedPrincipal
        Returns the name of the authenticated Principal. Never null.
        Specified by:
        getName in interface AuthenticatedPrincipal
        Returns:
        the name of the authenticated Principal
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

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

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object