Interface Authentication

All Superinterfaces:
Browsable, Extensible, Identifiable, OsidObject

public interface Authentication extends OsidObject

Authentication represents an authentication credential which contains set of bytes and a format Type. Once an Authentication is created from the AuthenticationValidationSession , the credential data can be extracted and sent to the remote peer for validation. The remote peer gets another Authentication object as a result of validating the serialized credential data.

An Authentication may or may not be valid. isValid() should be checked before acting upon the Agent identity to which the credential is mapped.

  • Method Details

    • getAgentId

      Id getAgentId()
      Gets the Id of the Agent identified in this authentication credential.
      Returns:
      the Agent Id
      Compliance:
      mandatory - This method must be implemented.
      Notes:
      The - Agent should be determined at the time this credential is created.
    • getAgent

      Agent getAgent() throws OperationFailedException
      Gets the Agent identified in this authentication credential.
      Returns:
      the Agent
      Throws:
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • isValid

      boolean isValid()
      Tests whether or not the credential represented by this Authentication is currently valid. A credential may be invalid because it has been destroyed, expired, or is somehow no longer able to be used.
      Returns:
      true if this authentication credential is valid, false otherwise
      Compliance:
      mandatory - This method must be implemented.
      Notes:
      Any - problem in determining the validity of this credential should result in {@code false} .
    • hasExpiration

      boolean hasExpiration()
      Tests if this authentication has an expiration.
      Returns:
      true if this authentication has an expiration, false otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getExpiration

      Date getExpiration()
      Gets the expiration date associated with this authentication credential. Consumers should check for the existence of an expiration mechanism via hasExpiration() .
      Returns:
      the expiration date of this authentication credential
      Throws:
      IllegalStateException - hasExpiration() is false
      Compliance:
      mandatory - This method must be implemented.
    • hasCredential

      boolean hasCredential()
      Tests if this authentication has a credential for export.
      Returns:
      true if this authentication has a credential, false otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getCredential

      Object getCredential(Type credentialType)
      Gets the credential represented by the given Type for transport to a remote service.
      Parameters:
      credentialType - the credential format Type
      Returns:
      the credential
      Throws:
      IllegalStateException - hasCredential() is false
      NullArgumentException - credentialType is null
      UnsupportedException - the given credentialType is not supported
      Compliance:
      mandatory - This method must be implemented.
      Notes:
      A - provider may support multiple credential formats for a variety of applications.
    • getAuthenticationRecord

      AuthenticationRecord getAuthenticationRecord(Type authenticationRecordType) throws OperationFailedException, PermissionDeniedException
      Gets the authentication record corresponding to the given authentication record Type . This method is used to retrieve an object implementing the requested record. The authenticationRecordType may be the Type returned in getRecordTypes() or any of its parents in a Type hierarchy where hasRecordType(authenticationRecordType) is true .
      Parameters:
      authenticationRecordType - the type of authentication record to retrieve
      Returns:
      the authentication record
      Throws:
      NullArgumentException - authenticationRecordType is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure occurred
      UnsupportedException - hasRecordType(authenticatonRecordType) is false
      Compliance:
      mandatory - This method must be implemented.