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.
Modifier and Type | Method and Description |
---|---|
Agent |
getAgent()
Gets the
Agent identified in this authentication
credential. |
Id |
getAgentId()
Gets the
Id of the Agent identified in
this authentication credential. |
AuthenticationRecord |
getAuthenticationRecord(Type authenticationRecordType)
Gets the authentication record corresponding to the given
authentication record
Type. |
java.lang.Object |
getCredential(Type credentialType)
Gets the credential represented by the given
Type for
transport to a remote service. |
java.util.Date |
getExpiration()
Gets the expiration date associated with this authentication
credential.
|
boolean |
hasCredential()
Tests if this authentication has a credential for export.
|
boolean |
hasExpiration()
Tests if this authentication has an expiration.
|
boolean |
isValid()
Tests whether or not the credential represented by this
Authentication is currently valid. |
getDescription, getDisplayName, getGenusType, isOfGenusType
getId, isCurrent
getRecordTypes, hasRecordType
getProperties, getPropertiesByRecordType
Id getAgentId()
Id
of the Agent
identified in
this authentication credential. Agent Id
mandatory
- This method must be implemented. The
- Agent should be determined at the time this credential is
created. Agent getAgent() throws OperationFailedException
Agent
identified in this authentication
credential. Agent
OperationFailedException
- unable to complete requestmandatory
- This method must be implemented. boolean isValid()
Authentication
is currently valid. A credential may be invalid
because it has been destroyed, expired, or is somehow no longer able
to be used. true
if this authentication credential is
valid, false
otherwisemandatory
- This method must be implemented. Any
- problem in determining the validity of this credential
should result in false.
boolean hasExpiration()
true
if this authentication has an expiration,
false
otherwisemandatory
- This method must be implemented. java.util.Date getExpiration()
hasExpiration().
IllegalStateException
- hasExpiration()
is false
mandatory
- This method must be implemented. boolean hasCredential()
true
if this authentication has a credential,
false
otherwisemandatory
- This method must be implemented. java.lang.Object getCredential(Type credentialType)
Type
for
transport to a remote service.credentialType
- the credential format Type
IllegalStateException
- hasCredential()
is false
NullArgumentException
- credentialType
is null
UnsupportedException
- the given credentialType
is not supportedmandatory
- This method must be implemented. A
- provider may support multiple credential formats for a
variety of applications. AuthenticationRecord getAuthenticationRecord(Type authenticationRecordType) throws OperationFailedException, PermissionDeniedException
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
.authenticationRecordType
- the type of authentication record to
retrieveNullArgumentException
- authenticationRecordType
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failure
occurredUnsupportedException
-
hasRecordType(authenticatonRecordType)
is false
mandatory
- This method must be implemented.