Interface CredentialMetadata

All Superinterfaces:
Serializable

public interface CredentialMetadata extends Serializable
Describes a credential provided for authentication. Implementations should expect instances of this type to be stored for periods of time equal to the length of the SSO session or longer, which necessitates consideration of serialization and security. All implementations MUST be serializable and secure with respect to long-term storage.
Since:
4.0.0
  • Field Details

    • PROPERTY_USER_AGENT

      static final String PROPERTY_USER_AGENT
      User agent property linked to this credential.
      See Also:
    • PROPERTY_GEO_LOCATION

      static final String PROPERTY_GEO_LOCATION
      Geo location property linked to this credential.
      See Also:
  • Method Details

    • getId

      String getId()
      Gets a unique identifier for the kind of credential this represents.
      Returns:
      Unique identifier for the given type of credential.
    • getCredentialClass

      Class<? extends Credential> getCredentialClass()
      Gets the type of the original credential.
      Returns:
      Non -null credential class.
    • addTrait

      CredentialMetadata addTrait(CredentialTrait credentialTrait)
      Add trait.
      Parameters:
      credentialTrait - the credential trait
    • removeTrait

      CredentialMetadata removeTrait(Class<? extends CredentialTrait> trait)
      Remove trait.
      Parameters:
      trait - the trait
    • getTrait

      <T extends CredentialTrait> Optional<T> getTrait(Class<T> trait)
      Gets trait.
      Type Parameters:
      T - the type parameter
      Parameters:
      trait - the trait
      Returns:
      the trait
    • getProperties

      Map<String,Serializable> getProperties()
      Gets properties.
      Returns:
      the properties
    • putProperties

      CredentialMetadata putProperties(Map<String,? extends Serializable> properties)
      Put properties.
      Parameters:
      properties - the properties
    • putProperty

      CredentialMetadata putProperty(String key, Serializable value)
      Put property credential metadata.
      Parameters:
      key - the key
      value - the value
      Returns:
      the credential metadata
    • containsProperty

      boolean containsProperty(String key)
      Contains property?.
      Parameters:
      key - the key
      Returns:
      true or false