Interface Authentication
- All Superinterfaces:
Browsable, Extensible, Identifiable, 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 Summary
Modifier and TypeMethodDescriptiongetAgent()Gets theAgentidentified in this authentication credential.Gets theIdof theAgentidentified in this authentication credential.getAuthenticationRecord(Type authenticationRecordType) Gets the authentication record corresponding to the given authentication recordType.getCredential(Type credentialType) Gets the credential represented by the givenTypefor transport to a remote service.Gets the expiration date associated with this authentication credential.booleanTests if this authentication has a credential for export.booleanTests if this authentication has an expiration.booleanisValid()Tests whether or not the credential represented by thisAuthenticationis currently valid.Methods inherited from interface Browsable
getProperties, getPropertiesByRecordTypeModifier and TypeMethodDescriptionGets a list of properties.getPropertiesByRecordType(Type recordType) Gets a list of properties corresponding to the specified record type.Methods inherited from interface Extensible
getRecordTypes, hasRecordTypeModifier and TypeMethodDescriptionGets the record types available in this object.booleanhasRecordType(Type recordType) Tests if this object supports the given recordType.Methods inherited from interface Identifiable
getId, isCurrentMethods inherited from interface OsidObject
getDescription, getDisplayName, getGenusType, isOfGenusTypeModifier and TypeMethodDescriptionGets the description associated with this instance of this OSID object.Gets the preferred display name associated with this instance of this OSID object appropriate for display to the user.Gets the genus type of this object.booleanisOfGenusType(Type genusType) Tests if this object is of the given genusType.
-
Method Details
-
getAgentId
Id getAgentId()Gets theIdof theAgentidentified 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
Gets theAgentidentified 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 thisAuthenticationis currently valid. A credential may be invalid because it has been destroyed, expired, or is somehow no longer able to be used.- Returns:
trueif this authentication credential is valid,falseotherwise- 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:
trueif this authentication has an expiration,falseotherwise- 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 viahasExpiration().- Returns:
- the expiration date of this authentication credential
- Throws:
IllegalStateException-hasExpiration()isfalse- Compliance:
mandatory- This method must be implemented.
-
hasCredential
boolean hasCredential()Tests if this authentication has a credential for export.- Returns:
trueif this authentication has a credential,falseotherwise- Compliance:
mandatory- This method must be implemented.
-
getCredential
Gets the credential represented by the givenTypefor transport to a remote service.- Parameters:
credentialType- the credential formatType- Returns:
- the credential
- Throws:
IllegalStateException-hasCredential()isfalseNullArgumentException-credentialTypeisnullUnsupportedException- the givencredentialTypeis 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 recordType. This method is used to retrieve an object implementing the requested record. TheauthenticationRecordTypemay be theTypereturned ingetRecordTypes()or any of its parents in aTypehierarchy wherehasRecordType(authenticationRecordType)istrue.- Parameters:
authenticationRecordType- the type of authentication record to retrieve- Returns:
- the authentication record
- Throws:
NullArgumentException-authenticationRecordTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure occurredUnsupportedException-hasRecordType(authenticatonRecordType)isfalse- Compliance:
mandatory- This method must be implemented.
-