Class DefaultOAuth2User

java.lang.Object
com.codename1.backend.security.oauth2.client.DefaultOAuth2User
All Implemented Interfaces:
OAuth2User
Direct Known Subclasses:
DefaultOidcUser

public class DefaultOAuth2User extends Object implements OAuth2User
An OAuth2User that holds what it is given.
  • Constructor Details

    • DefaultOAuth2User

      public DefaultOAuth2User(Collection<? extends GrantedAuthority> authorities, Map<String,Object> attributes, String nameAttributeKey)
      Parameters:
      nameAttributeKey - the attribute whose value names the user
    • DefaultOAuth2User

      public DefaultOAuth2User(String name, Collection<? extends GrantedAuthority> authorities, Map<String,Object> attributes)
      A user called name, whatever the attributes say: for a service that ties the provider's user to an account of the application's.
  • Method Details

    • getAttributes

      public Map<String,Object> getAttributes()
      Description copied from interface: OAuth2User
      What the provider said of the user, by name.
      Specified by:
      getAttributes in interface OAuth2User
    • getAuthorities

      public Collection<? extends GrantedAuthority> getAuthorities()
      Specified by:
      getAuthorities in interface OAuth2User
    • getName

      public String getName()
      Description copied from interface: OAuth2User
      What the user is called here: the value of the provider's name attribute, or the local account an OAuth2UserService tied them to.
      Specified by:
      getName in interface OAuth2User
    • toString

      public String toString()
      Description copied from class: Object
      Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method. The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of: getClass().getName() + '@' + Integer.toHexString(hashCode())
      Overrides:
      toString in class Object