Objects¶
Authentication¶
-
class
dlkit.authentication_process.objects.
Authentication
¶ Bases:
dlkit.osid.objects.OsidObject
Authentication
represents an authentication credential which contains set ofbytes
and a format Type.Once an
Authentication
is created from theAuthenticationValidationSession,
the credential data can be extracted and sent to the remote peer for validation. The remote peer gets anotherAuthentication
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 theAgent
identity to which the credential is mapped.-
agent_id
¶ Gets the
Id
of theAgent
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 requestcompliance: 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
otherwiseReturn 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
otherwiseReturn 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: IllegalState
–has_expiration()
isfalse
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
otherwiseReturn 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 formatType
Returns: the credential Return type: object
Raise: IllegalState
–has_credential()
isfalse
Raise: NullArgument
–credential_type
isnull
Raise: Unsupported
– the givencredential_type
is not supportedcompliance: 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 theType
returned inget_record_types()
or any of its parents in aType
hierarchy wherehas_record_type(authentication_record_type)
istrue
.Parameters: authentication_record_type ( osid.type.Type
) – the type of authentication record to retrieveReturns: the authentication record Return type: osid.authentication.process.records.AuthenticationRecord
Raise: NullArgument
–authentication_record_type
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failure occurredRaise: Unsupported
–has_record_type(authenticaton_record_type)
isfalse
compliance: mandatory – This method must be implemented.
-