public interface AuthScheme
This interface represents an abstract challenge-response oriented authentication scheme.
An authentication scheme should be able to support the following functions:
Authentication schemes may ignore method name and URI parameters if they are not relevant for the given authentication mechanism
Authentication schemes may be stateful involving a series of challenge-response exchanges
Modifier and Type | Method and Description |
---|---|
java.lang.String |
authenticate(Credentials credentials,
HttpMethod method)
Produces an authorization string for the given set of
Credentials . |
java.lang.String |
authenticate(Credentials credentials,
java.lang.String method,
java.lang.String uri)
Deprecated.
Use
authenticate(Credentials, HttpMethod)
Produces an authorization string for the given set of Credentials ,
method name and URI using the given authentication scheme in response to
the actual authorization challenge. |
java.lang.String |
getID()
Deprecated.
no longer used
|
java.lang.String |
getParameter(java.lang.String name)
Returns authentication parameter with the given name, if available.
|
java.lang.String |
getRealm()
Returns authentication realm.
|
java.lang.String |
getSchemeName()
Returns textual designation of the given authentication scheme.
|
boolean |
isComplete()
Authentication process may involve a series of challenge-response exchanges.
|
boolean |
isConnectionBased()
Tests if the authentication scheme is provides authorization on a per
connection basis instead of usual per request basis
|
void |
processChallenge(java.lang.String challenge)
Processes the given challenge token.
|
void processChallenge(java.lang.String challenge) throws MalformedChallengeException
challenge
- the challenge stringMalformedChallengeException
java.lang.String getSchemeName()
java.lang.String getParameter(java.lang.String name)
name
- The name of the parameter to be returnedjava.lang.String getRealm()
null
.java.lang.String getID()
Additionally, the ID should take into account any changes to the authentication challenge and return a different value when appropriate. For example when the realm changes in basic authentication it should be considered a different authentication attempt and a different value should be returned.
boolean isConnectionBased()
boolean isComplete()
java.lang.String authenticate(Credentials credentials, java.lang.String method, java.lang.String uri) throws AuthenticationException
authenticate(Credentials, HttpMethod)
Produces an authorization string for the given set of Credentials
,
method name and URI using the given authentication scheme in response to
the actual authorization challenge.credentials
- The set of credentials to be used for athenticationmethod
- The name of the method that requires authorization.
This parameter may be ignored, if it is irrelevant
or not applicable to the given authentication schemeuri
- The URI for which authorization is needed.
This parameter may be ignored, if it is irrelevant or not
applicable to the given authentication schemeAuthenticationException
- if authorization string cannot
be generated due to an authentication failureHttpMethod.getName()
,
HttpMethod.getPath()
java.lang.String authenticate(Credentials credentials, HttpMethod method) throws AuthenticationException
Credentials
.credentials
- The set of credentials to be used for athenticationmethod
- The method being authenticatedAuthenticationException
- if authorization string cannot
be generated due to an authentication failureCopyright © 2010 - 2019 Adobe. All Rights Reserved