public class DigestScheme extends Object implements AuthScheme, Serializable
Since the digest username is included as clear text in the generated Authentication header, the charset of the username must be compatible with the HTTP element charset used by the connection.
| 构造器和说明 |
|---|
DigestScheme() |
DigestScheme(Charset charset) |
| 限定符和类型 | 方法和说明 |
|---|---|
String |
generateAuthResponse(HttpHost host,
HttpRequest request,
HttpContext context)
Generates an authorization response based on the current state.
|
String |
getCnonce() |
String |
getName()
Returns textual designation of the given authentication scheme.
|
String |
getNonce() |
long |
getNounceCount() |
Principal |
getPrincipal()
Returns
Principal whose credentials are used to generate
an authentication response. |
String |
getRealm()
Returns authentication realm.
|
void |
initPreemptive(Credentials credentials,
String cnonce,
String realm) |
boolean |
isChallengeComplete()
Authentication process may involve a series of challenge-response exchanges.
|
boolean |
isConnectionBased()
Determines if the authentication scheme is expected to provide an authorization response
on a per connection basis instead of the standard per request basis
|
boolean |
isResponseReady(HttpHost host,
CredentialsProvider credentialsProvider,
HttpContext context)
Determines whether or not an authorization response can be generated based on
the actual authentication state.
|
void |
processChallenge(AuthChallenge authChallenge,
HttpContext context)
Processes the given auth challenge.
|
String |
toString() |
public DigestScheme()
public DigestScheme(Charset charset)
public void initPreemptive(Credentials credentials, String cnonce, String realm)
public String getName()
AuthSchemegetName 在接口中 AuthSchemepublic boolean isConnectionBased()
AuthSchemeisConnectionBased 在接口中 AuthSchemetrue if the scheme is connection based, false
if the scheme is request based.public String getRealm()
AuthSchemenull.getRealm 在接口中 AuthSchemepublic void processChallenge(AuthChallenge authChallenge, HttpContext context) throws MalformedChallengeException
AuthSchemeprocessChallenge 在接口中 AuthSchemeauthChallenge - the auth challengecontext - HTTP contextMalformedChallengeException - in case the auth challenge is incomplete,
malformed or otherwise invalid.public boolean isChallengeComplete()
AuthSchemeisChallengeComplete 在接口中 AuthSchemetrue if the authentication process has been completed,
false otherwise.public boolean isResponseReady(HttpHost host, CredentialsProvider credentialsProvider, HttpContext context) throws AuthenticationException
AuthSchemeisResponseReady 在接口中 AuthSchemecredentialsProvider - The credentials to be used for authenticationcontext - HTTP contexttrue if an authorization response can be generated and
the authentication handshake can proceed, false otherwise.AuthenticationException - if authorization string cannot
be generated due to an authentication failurepublic Principal getPrincipal()
AuthSchemePrincipal whose credentials are used to generate
an authentication response. Connection based schemes are required
to return a user Principal if authorization applies to
for the entire life span of connection.getPrincipal 在接口中 AuthSchemeAuthScheme.isConnectionBased()public String generateAuthResponse(HttpHost host, HttpRequest request, HttpContext context) throws AuthenticationException
AuthSchemeCredentialsProvider prior to this method call.generateAuthResponse 在接口中 AuthSchemerequest - The request being authenticatedcontext - HTTP contextAuthenticationException - if authorization string cannot
be generated due to an authentication failureAuthScheme.isResponseReady(HttpHost, CredentialsProvider, HttpContext)@Internal public long getNounceCount()
Copyright © 2023. All rights reserved.