Class RecoveryCodeValidationAttributes

Object
se.curity.identityserver.sdk.attribute.MapAttributeValue
se.curity.identityserver.sdk.attribute.optinmfa.RecoveryCodeValidationAttributes
All Implemented Interfaces:
Iterable<Attribute>, AttributeContainer<MapAttributeValue>, AttributeOrAttributeValue<AttributeValue>, AttributeValue, SerializableAsMap

public final class RecoveryCodeValidationAttributes extends MapAttributeValue
A recovery code, which may be consumed.
Since:
8.1
  • Field Details

  • Method Details

    • of

      public static RecoveryCodeValidationAttributes of(String validationInfo, @Nullable Instant consumedAt)
      Creates a recovery code from the given attributes. The recovery code is consumed when consumedAt parameter is provided.
      Parameters:
      validationInfo - the recovery code
      consumedAt - an optional instant, in seconds from EPOCH, at which the recovery code was consumed
      Returns:
      a recovery code from the given attributes
    • of

      public static RecoveryCodeValidationAttributes of(Iterable<Attribute> attributes)
      Creates a recovery code from the given attributes. The recovery code is consumed when CONSUMED_AT attribute is provided.
      Parameters:
      attributes - the attributes to create the recovery code from. VALIDATION_INFO attribute is mandatory
      Returns:
      a recovery code from the given attributes
    • getValidationInfo

      public String getValidationInfo()
      Returns:
      the recovery code.
    • getConsumedAt

      @Nullable public @Nullable Instant getConsumedAt()
      Returns:
      the instant, in seconds from EPOCH, at which the recovery code was consumed, null otherwise.
    • isConsumed

      public boolean isConsumed()
      Returns:
      true if this recovery code was consumed, false otherwise.