Package app.services.model
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the attributes of the user provided by the external provider.Collection<? extends org.springframework.security.core.GrantedAuthority> Returns the authorities granted to the user represented by this object.getEmail()The user email in external provider.The user last name in external provider.The user first name in external provider.getName()The user full name in external provider.getSub()Returns the provider unique identifier of the user represented by this object.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.security.oauth2.core.OAuth2AuthenticatedPrincipal
getAttribute
-
Constructor Details
-
ExternalProviderUser
public ExternalProviderUser()
-
-
Method Details
-
getAttributes
Returns the attributes of the user provided by the external provider.- Specified by:
getAttributesin interfaceorg.springframework.security.oauth2.core.OAuth2AuthenticatedPrincipal- Returns:
- a Map containing the attributes of the user.
- See Also:
-
getAuthorities
Returns the authorities granted to the user represented by this object.- Specified by:
getAuthoritiesin interfaceorg.springframework.security.oauth2.core.OAuth2AuthenticatedPrincipal- Returns:
- a collection of
GrantedAuthoritys that the user is granted. - See Also:
-
getSub
Returns the provider unique identifier of the user represented by this object.- Returns:
- the unique identifier of the user.
-
getName
The user full name in external provider.- Specified by:
getNamein interfaceorg.springframework.security.core.AuthenticatedPrincipal
-
getGivenName
The user first name in external provider. -
getFamilyName
The user last name in external provider. -
getEmail
The user email in external provider.
-