Package org.localify.auth.dto.web
Class GoogleJwtUserDetails
java.lang.Object
org.localify.auth.dto.web.GoogleJwtUserDetails
- All Implemented Interfaces:
Serializable
Represents the user details extracted from a Google JWT.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic GoogleJwtUserDetailsfromPayload(com.google.api.client.googleapis.auth.oauth2.GoogleIdToken.Payload payload) Creates a GoogleJwtUserDetails object from a Google ID token payload.getEmail()Gets the user's email.Gets the user's family name.Gets the user's given name.Gets the hosted domain of the user (for G Suite accounts).Gets the user's locale.getName()Gets the user's full name.Gets the URL of the user's profile picture.Gets the user ID.booleanChecks if the email is verified.Sets the user's email.setEmailVerified(boolean emailVerified) Sets whether the email is verified.setFamilyName(String familyName) Sets the user's family name.setGivenName(String givenName) Sets the user's given name.setHostedDomain(String hostedDomain) Sets the hosted domain of the user.Sets the user's locale.Sets the user's full name.setPictureUrl(String pictureUrl) Sets the URL of the user's profile picture.Sets the user ID.
-
Constructor Details
-
GoogleJwtUserDetails
public GoogleJwtUserDetails()
-
-
Method Details
-
getUserId
Gets the user ID.- Returns:
- The user ID.
-
setUserId
Sets the user ID.- Parameters:
userId- The user ID.- Returns:
- This GoogleJwtUserDetails instance.
-
getEmail
Gets the user's email.- Returns:
- The email.
-
setEmail
Sets the user's email.- Parameters:
email- The email.- Returns:
- This GoogleJwtUserDetails instance.
-
isEmailVerified
public boolean isEmailVerified()Checks if the email is verified.- Returns:
- True if the email is verified, false otherwise.
-
setEmailVerified
Sets whether the email is verified.- Parameters:
emailVerified- True if the email is verified, false otherwise.- Returns:
- This GoogleJwtUserDetails instance.
-
getName
Gets the user's full name.- Returns:
- The name.
-
setName
Sets the user's full name.- Parameters:
name- The name.- Returns:
- This GoogleJwtUserDetails instance.
-
getPictureUrl
Gets the URL of the user's profile picture.- Returns:
- The picture URL.
-
setPictureUrl
Sets the URL of the user's profile picture.- Parameters:
pictureUrl- The picture URL.- Returns:
- This GoogleJwtUserDetails instance.
-
getLocale
Gets the user's locale.- Returns:
- The locale.
-
setLocale
Sets the user's locale.- Parameters:
locale- The locale.- Returns:
- This GoogleJwtUserDetails instance.
-
getFamilyName
Gets the user's family name.- Returns:
- The family name.
-
setFamilyName
Sets the user's family name.- Parameters:
familyName- The family name.- Returns:
- This GoogleJwtUserDetails instance.
-
getGivenName
Gets the user's given name.- Returns:
- The given name.
-
setGivenName
Sets the user's given name.- Parameters:
givenName- The given name.- Returns:
- This GoogleJwtUserDetails instance.
-
getHostedDomain
Gets the hosted domain of the user (for G Suite accounts).- Returns:
- The hosted domain.
-
setHostedDomain
Sets the hosted domain of the user.- Parameters:
hostedDomain- The hosted domain.- Returns:
- This GoogleJwtUserDetails instance.
-
fromPayload
public static GoogleJwtUserDetails fromPayload(com.google.api.client.googleapis.auth.oauth2.GoogleIdToken.Payload payload) Creates a GoogleJwtUserDetails object from a Google ID token payload.- Parameters:
payload- The Google ID token payload.- Returns:
- A new GoogleJwtUserDetails object.
-