Class GoogleJwtUserDetails

java.lang.Object
org.localify.auth.dto.web.GoogleJwtUserDetails
All Implemented Interfaces:
Serializable

public class GoogleJwtUserDetails extends Object implements Serializable
Represents the user details extracted from a Google JWT.
See Also:
  • Constructor Details

    • GoogleJwtUserDetails

      public GoogleJwtUserDetails()
  • Method Details

    • getUserId

      public String getUserId()
      Gets the user ID.
      Returns:
      The user ID.
    • setUserId

      public GoogleJwtUserDetails setUserId(String userId)
      Sets the user ID.
      Parameters:
      userId - The user ID.
      Returns:
      This GoogleJwtUserDetails instance.
    • getEmail

      public String getEmail()
      Gets the user's email.
      Returns:
      The email.
    • setEmail

      public GoogleJwtUserDetails setEmail(String email)
      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

      public GoogleJwtUserDetails setEmailVerified(boolean emailVerified)
      Sets whether the email is verified.
      Parameters:
      emailVerified - True if the email is verified, false otherwise.
      Returns:
      This GoogleJwtUserDetails instance.
    • getName

      public String getName()
      Gets the user's full name.
      Returns:
      The name.
    • setName

      public GoogleJwtUserDetails setName(String name)
      Sets the user's full name.
      Parameters:
      name - The name.
      Returns:
      This GoogleJwtUserDetails instance.
    • getPictureUrl

      public String getPictureUrl()
      Gets the URL of the user's profile picture.
      Returns:
      The picture URL.
    • setPictureUrl

      public GoogleJwtUserDetails setPictureUrl(String pictureUrl)
      Sets the URL of the user's profile picture.
      Parameters:
      pictureUrl - The picture URL.
      Returns:
      This GoogleJwtUserDetails instance.
    • getLocale

      public String getLocale()
      Gets the user's locale.
      Returns:
      The locale.
    • setLocale

      public GoogleJwtUserDetails setLocale(String locale)
      Sets the user's locale.
      Parameters:
      locale - The locale.
      Returns:
      This GoogleJwtUserDetails instance.
    • getFamilyName

      public String getFamilyName()
      Gets the user's family name.
      Returns:
      The family name.
    • setFamilyName

      public GoogleJwtUserDetails setFamilyName(String familyName)
      Sets the user's family name.
      Parameters:
      familyName - The family name.
      Returns:
      This GoogleJwtUserDetails instance.
    • getGivenName

      public String getGivenName()
      Gets the user's given name.
      Returns:
      The given name.
    • setGivenName

      public GoogleJwtUserDetails setGivenName(String givenName)
      Sets the user's given name.
      Parameters:
      givenName - The given name.
      Returns:
      This GoogleJwtUserDetails instance.
    • getHostedDomain

      public String getHostedDomain()
      Gets the hosted domain of the user (for G Suite accounts).
      Returns:
      The hosted domain.
    • setHostedDomain

      public GoogleJwtUserDetails setHostedDomain(String hostedDomain)
      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.