public class DigestAuthenticator extends ChallengeAuthenticator
ChallengeScheme.HTTP_DIGEST
scheme.DigestVerifier
,
DigestAuthenticator
Constructor and Description |
---|
DigestAuthenticator(Context context,
boolean optional,
String realm,
List<Reference> domainRefs,
String serverKey)
Constructor.
|
DigestAuthenticator(Context context,
String realm,
String serverKey)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected ChallengeRequest |
createChallengeRequest(boolean stale)
Creates a new challenge request.
|
String |
generateServerNonce()
Generates a server nonce.
|
List<Reference> |
getDomainRefs()
Returns the base URI references that collectively define the protected
domains for the digest authentication.
|
String |
getHashedSecret(String identifier,
char[] secret)
Return the hashed secret.
|
long |
getMaxServerNonceAge()
Returns the number of milliseconds between each mandatory nonce refresh.
|
String |
getServerKey()
Returns the secret key known only by server.
|
DigestVerifier<LocalVerifier> |
getVerifier()
Returns the credentials verifier.
|
void |
setDomainRefs(List<Reference> domainRefs)
Sets the URI references that define the protection domains for the digest
authentication.
|
void |
setMaxServerNonceAge(long maxServerNonceAge)
Sets the number of milliseconds between each mandatory nonce refresh.
|
void |
setServerKey(String serverKey)
Sets the secret key known only by server.
|
void |
setVerifier(Verifier verifier)
Set the internal verifier.
|
void |
setWrappedAlgorithm(String wrappedAlgorithm)
Sets the digest algorithm of secrets returned by the wrapped verifier.
|
void |
setWrappedVerifier(LocalVerifier localVerifier)
Sets the secret verifier that will be wrapped by real verifier supporting
all the HTTP DIGEST verifications (nonce, domain URIs, etc.).
|
authenticate, challenge, forbid, getRealm, getScheme, isRechallenging, setRealm, setRechallenging
authenticated, beforeHandle, getEnroler, isMultiAuthenticating, isOptional, setEnroler, setMultiAuthenticating, setOptional, unauthenticated
afterHandle, doHandle, getNext, handle, hasNext, setNext, setNext, start, stop
createFinder, finalize, getApplication, getAuthor, getContext, getDescription, getFinderClass, getLogger, getName, getOwner, handle, handle, handle, isStarted, isStopped, setAuthor, setContext, setDescription, setFinderClass, setName, setOwner
public DigestAuthenticator(Context context, boolean optional, String realm, List<Reference> domainRefs, String serverKey)
ChallengeScheme.HTTP_DIGEST
and the nonce lifespan to 5 minutes
by default.context
- The context.optional
- Indicates if the authentication success is optional.realm
- The authentication realm.domainRefs
- The URI references that define the protection domains.serverKey
- The secret key known only to server.public DigestAuthenticator(Context context, String realm, String serverKey)
context
- The context.realm
- The authentication realm.serverKey
- secret key known only to serverprotected ChallengeRequest createChallengeRequest(boolean stale)
ChallengeAuthenticator
createChallengeRequest
in class ChallengeAuthenticator
stale
- Indicates if the new challenge is due to a stale response.public String generateServerNonce()
public List<Reference> getDomainRefs()
public String getHashedSecret(String identifier, char[] secret)
identifier
- The user identifier to hash.secret
- The user secret.public long getMaxServerNonceAge()
public String getServerKey()
public DigestVerifier<LocalVerifier> getVerifier()
ChallengeAuthenticator
getVerifier
in class ChallengeAuthenticator
public void setDomainRefs(List<Reference> domainRefs)
domainRefs
- The base URI references.public void setMaxServerNonceAge(long maxServerNonceAge)
maxServerNonceAge
- The nonce lifespan in milliseconds.public void setServerKey(String serverKey)
serverKey
- The server secret key.public void setVerifier(Verifier verifier)
setWrappedVerifier(LocalVerifier)
method.setVerifier
in class ChallengeAuthenticator
verifier
- The internal verifier.public void setWrappedAlgorithm(String wrappedAlgorithm)
wrappedAlgorithm
- The digest algorithm of secrets returned by the wrapped
verifier.Digest
public void setWrappedVerifier(LocalVerifier localVerifier)
localVerifier
- The local verifier to wrap.Copyright © 2005–2015. All rights reserved.