public interface AuthScheme
An authentication scheme should be able to support the following functions:
Authentication schemes may be stateful involving a series of challenge-response exchanges.
Modifier and Type | Method and Description |
---|---|
Header |
authenticate(Credentials credentials,
HttpRequest request)
Produces an authorization string for the given set of
Credentials . |
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(Header header)
Processes the given challenge token.
|
void processChallenge(Header header) throws MalformedChallengeException
header
- the challenge headerMalformedChallengeException
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
.boolean isConnectionBased()
boolean isComplete()
Header authenticate(Credentials credentials, HttpRequest request) throws AuthenticationException
Credentials
.credentials
- The set of credentials to be used for athenticationrequest
- The request being authenticatedAuthenticationException
- if authorization string cannot
be generated due to an authentication failure