Record Class FederatedIdentity

java.lang.Object
java.lang.Record
com.irurueta.authserver.authorization.domain.social.FederatedIdentity
Record Components:
id - identifier of the link.
userId - identifier of the local account (the users row).
provider - provider that holds the identity.
subject - stable identifier the provider assigned to the user (the sub claim, or the numeric id of GitHub).
email - e-mail address the provider reported when the identity was last used, or null.
linkedAt - instant at which the identity was linked.
lastLoginAt - instant of the last sign-in with it, or null when it has not been used since it was linked.

public record FederatedIdentity(UUID id, UUID userId, IdentityProvider provider, String subject, String email, Instant linkedAt, Instant lastLoginAt) extends Record
An identity of an external provider linked to a local account: the account is reached by presenting the provider's stable subject, never by its e-mail address, which a provider may change.
  • Field Details

    • id

      private final UUID id
      The field for the id record component.
    • userId

      private final UUID userId
      The field for the userId record component.
    • provider

      private final IdentityProvider provider
      The field for the provider record component.
    • subject

      private final String subject
      The field for the subject record component.
    • email

      private final String email
      The field for the email record component.
    • linkedAt

      private final Instant linkedAt
      The field for the linkedAt record component.
    • lastLoginAt

      private final Instant lastLoginAt
      The field for the lastLoginAt record component.
  • Constructor Details

  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • id

      public UUID id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • userId

      public UUID userId()
      Returns the value of the userId record component.
      Returns:
      the value of the userId record component
    • provider

      public IdentityProvider provider()
      Returns the value of the provider record component.
      Returns:
      the value of the provider record component
    • subject

      public String subject()
      Returns the value of the subject record component.
      Returns:
      the value of the subject record component
    • email

      public String email()
      Returns the value of the email record component.
      Returns:
      the value of the email record component
    • linkedAt

      public Instant linkedAt()
      Returns the value of the linkedAt record component.
      Returns:
      the value of the linkedAt record component
    • lastLoginAt

      public Instant lastLoginAt()
      Returns the value of the lastLoginAt record component.
      Returns:
      the value of the lastLoginAt record component