Interface Credential

All Superinterfaces:
Serializable
All Known Subinterfaces:
MutableCredential, RememberMeCredential

public interface Credential extends Serializable
Describes an authentication credential. Implementations SHOULD also implement CredentialMetadata if no sensitive data is contained in the credential; conversely, implementations MUST NOT implement CredentialMetadata if the credential contains sensitive data (e.g. password, key material).
Since:
3.0.0
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Credential type, collected as metadata for authentication.
    static final String
    An ID that may be used to indicate the credential identifier is unknown.
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets credential metadata.
    Gets a credential identifier that is safe to record for logging, auditing, or presentation to the user.
  • Field Details

    • CREDENTIAL_TYPE_ATTRIBUTE

      static final String CREDENTIAL_TYPE_ATTRIBUTE
      Credential type, collected as metadata for authentication.
      See Also:
    • UNKNOWN_ID

      static final String UNKNOWN_ID
      An ID that may be used to indicate the credential identifier is unknown.
      See Also:
  • Method Details

    • getId

      String getId()
      Gets a credential identifier that is safe to record for logging, auditing, or presentation to the user. In most cases this has a natural meaning for most credential types (e.g. username, certificate DN), while for others it may be awkward to construct a meaningful identifier. In any case credentials require some means of identification for a number of cases and implementers should make a best effort to satisfy that need.
      Returns:
      Non-null credential identifier. Implementers should return UNKNOWN_ID for cases where an ID is not readily available or meaningful.
    • getCredentialMetadata

      CredentialMetadata getCredentialMetadata()
      Gets credential metadata.
      Returns:
      the credential metadata