Objects

Authentication

class dlkit.authentication_process.objects.Authentication

Bases: dlkit.osid.objects.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. is_valid() should be checked before acting upon the Agent identity to which the credential is mapped.

agent_id

Gets the Id of the Agent identified in this authentication credential.

Returns:the Agent Id
Return type:osid.id.Id

compliance: mandatory – This method must be implemented. implementation notes: The Agent should be determined at the time this credential is created.

agent

Gets the Agent identified in this authentication credential.

Returns:the Agent
Return type:osid.authentication.Agent
Raise:OperationFailed – unable to complete request

compliance: mandatory – This method must be implemented.

is_valid()

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
Return type:boolean

compliance: mandatory – This method must be implemented. implementation notes: Any problem in determining the validity of this credential should result in false.

has_expiration()

Tests if this authentication has an expiration.

Returns:true if this authentication has an expiration, false otherwise
Return type:boolean

compliance: mandatory – This method must be implemented.

expiration

Gets the expiration date associated with this authentication credential.

Consumers should check for the existence of a an expiration mechanism via hasExpiration().

Returns:the expiration date of this authentication credential
Return type:timestamp
Raise:IllegalStatehas_expiration() is false

compliance: mandatory – This method must be implemented.

has_credential()

Tests if this authentication has a credential for export.

Returns:true if this authentication has a credential, false otherwise
Return type:boolean

compliance: mandatory – This method must be implemented.

get_credential(credential_type)

Gets the credential represented by the given Type for transport to a remote service.

Parameters:credential_type (osid.type.Type) – the credential format Type
Returns:the credential
Return type:object
Raise:IllegalStatehas_credential() is false
Raise:NullArgumentcredential_type is null
Raise:Unsupported – the given credential_type is not supported

compliance: mandatory – This method must be implemented. implementation notes: A provider may support multiple credential formats for a variety of applications.

get_authentication_record(authentication_record_type)

Gets the authentication record corresponding to the given authentication record Type.

This method is used to retrieve an object implementing the requested record. The authentication_record_type may be the Type returned in get_record_types() or any of its parents in a Type hierarchy where has_record_type(authentication_record_type) is true .

Parameters:authentication_record_type (osid.type.Type) – the type of authentication record to retrieve
Returns:the authentication record
Return type:osid.authentication.process.records.AuthenticationRecord
Raise:NullArgumentauthentication_record_type is null
Raise:OperationFailed – unable to complete request
Raise:PermissionDenied – authorization failure occurred
Raise:Unsupportedhas_record_type(authenticaton_record_type) is false

compliance: mandatory – This method must be implemented.