public class HttpDigestHelper extends AuthenticatorHelper
Constructor and Description |
---|
HttpDigestHelper()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
formatRequest(ChallengeWriter cw,
ChallengeRequest challenge,
Response response,
Series<Header> httpHeaders)
Formats a challenge request as raw credentials.
|
void |
formatResponse(ChallengeWriter cw,
ChallengeResponse challenge,
Request request,
Series<Header> httpHeaders)
Formats a challenge response as raw credentials.
|
char[] |
formatResponseDigest(ChallengeResponse challengeResponse,
Request request)
Formats the response digest.
|
static boolean |
isNonceValid(String nonce,
String secretKey,
long lifespan)
Checks whether the specified nonce is valid with respect to the specified
secretKey, and further confirms that the nonce was generated less than
lifespanMillis milliseconds ago
|
void |
parseRequest(ChallengeRequest challenge,
Response response,
Series<Header> httpHeaders)
Parses an authenticate header into a challenge request.
|
void |
parseResponse(ChallengeResponse challenge,
Request request,
Series<Header> httpHeaders)
Parses an authorization header into a challenge response.
|
getChallengeScheme, getLogger, isClientSide, isServerSide, setChallengeScheme, setClientSide, setServerSide, updateReference
public static boolean isNonceValid(String nonce, String secretKey, long lifespan) throws Exception
nonce
- The nonce value.secretKey
- The same secret value that was inserted into the nonce when it
was generatedlifespan
- The nonce lifespan in milliseconds.Exception
- If the nonce does not match the specified secretKey, or if it
can't be parsedpublic void formatRequest(ChallengeWriter cw, ChallengeRequest challenge, Response response, Series<Header> httpHeaders) throws IOException
AuthenticatorHelper
formatRequest
in class AuthenticatorHelper
cw
- The header writer to update.challenge
- The challenge request to format.response
- The parent response.httpHeaders
- The current request HTTP headers.IOException
public void formatResponse(ChallengeWriter cw, ChallengeResponse challenge, Request request, Series<Header> httpHeaders)
AuthenticatorHelper
formatResponse
in class AuthenticatorHelper
cw
- The header writer to update.challenge
- The challenge response to format.request
- The parent request.httpHeaders
- The current request HTTP headers.public char[] formatResponseDigest(ChallengeResponse challengeResponse, Request request)
challengeResponse
- The challenge response.request
- The request if available.public void parseRequest(ChallengeRequest challenge, Response response, Series<Header> httpHeaders)
AuthenticatorHelper
HeaderConstants.HEADER_WWW_AUTHENTICATE
.parseRequest
in class AuthenticatorHelper
challenge
- The challenge request to update.response
- The parent response.httpHeaders
- The current response HTTP headers.public void parseResponse(ChallengeResponse challenge, Request request, Series<Header> httpHeaders)
AuthenticatorHelper
HeaderConstants.HEADER_AUTHORIZATION
.parseResponse
in class AuthenticatorHelper
challenge
- The challenge response to update.request
- The parent request.httpHeaders
- The current request HTTP headers.Copyright © 2005–2016. All rights reserved.