Class ExternalProviderUser

java.lang.Object
app.services.model.ExternalProviderUser
All Implemented Interfaces:
org.springframework.security.core.AuthenticatedPrincipal, org.springframework.security.oauth2.core.OAuth2AuthenticatedPrincipal, org.springframework.security.oauth2.core.user.OAuth2User

public class ExternalProviderUser extends Object implements org.springframework.security.oauth2.core.user.OAuth2User
Questa classe funge da mapping fra l'oggetto di ritorno dal provider e il mio oggetto nel database.
  • Constructor Details

    • ExternalProviderUser

      public ExternalProviderUser()
  • Method Details

    • getAttributes

      public Map<String,Object> getAttributes()
      Returns the attributes of the user provided by the external provider.
      Specified by:
      getAttributes in interface org.springframework.security.oauth2.core.OAuth2AuthenticatedPrincipal
      Returns:
      a Map containing the attributes of the user.
      See Also:
      • OAuth2AuthenticatedPrincipal.getAttributes()
    • getAuthorities

      public Collection<? extends org.springframework.security.core.GrantedAuthority> getAuthorities()
      Returns the authorities granted to the user represented by this object.
      Specified by:
      getAuthorities in interface org.springframework.security.oauth2.core.OAuth2AuthenticatedPrincipal
      Returns:
      a collection of GrantedAuthoritys that the user is granted.
      See Also:
      • OAuth2AuthenticatedPrincipal.getAuthorities()
    • getSub

      public String getSub()
      Returns the provider unique identifier of the user represented by this object.
      Returns:
      the unique identifier of the user.
    • getName

      public String getName()
      The user full name in external provider.
      Specified by:
      getName in interface org.springframework.security.core.AuthenticatedPrincipal
    • getGivenName

      public String getGivenName()
      The user first name in external provider.
    • getFamilyName

      public String getFamilyName()
      The user last name in external provider.
    • getEmail

      public String getEmail()
      The user email in external provider.