Record Class ProviderTrust

java.lang.Object
java.lang.Record
com.irurueta.authserver.authorization.domain.social.ProviderTrust
Record Components:
provider - provider the setting belongs to.
trustMfa - whether the provider's multi-factor claim is trusted.

public record ProviderTrust(IdentityProvider provider, boolean trustMfa) extends Record
How far a provider's own multi-factor authentication is trusted. By default a federated sign-in is a primary factor and the normal second-factor flow applies; only a provider marked as trusted, whose upstream amr claim proves mfa, is accepted as a strong sign-in on its own.
  • Field Details

    • provider

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

      private final boolean trustMfa
      The field for the trustMfa record component.
    • MFA_AMR

      public static final String MFA_AMR
      The amr value (RFC 8176) that says the provider authenticated the user with several factors.
      See Also:
  • Constructor Details

  • Method Details

    • isStrong

      public boolean isStrong(Collection<String> upstreamAmr)
      Tells whether a sign-in counts as strong, that is, whether it proves identity without a second factor.
      Parameters:
      upstreamAmr - amr values the provider reported, or null when it reported none.
      Returns:
      true when the provider is trusted and its amr contains "mfa".
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • provider

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

      public boolean trustMfa()
      Returns the value of the trustMfa record component.
      Returns:
      the value of the trustMfa record component