AuthorizationChallengeHandler Class
- java.
lang. Object - com.
azure. core. util. AuthorizationChallengeHandler
- com.
public class AuthorizationChallengeHandler
This class handles Basic and Digest authorization challenges, complying to RFC 2617 and RFC 7616.
Field Summary
| Modifier and Type | Field and Description |
|---|---|
| static final String |
AUTHENTICATION_INFO
Header representing additional information a server is expecting during future authentication requests. |
| static final String |
AUTHORIZATION
Header representing the authorization the client is presenting to a server. |
| static final String |
PROXY_AUTHENTICATE
Header representing a proxy server requesting authentication. |
| static final String |
PROXY_AUTHENTICATION_INFO
Header representing additional information a proxy server is expecting during future authentication requests. |
| static final String |
PROXY_AUTHORIZATION
Header representing the authorization the client is presenting to a proxy server. |
| static final String |
WWW_AUTHENTICATE
Header representing a server requesting authentication. |
Constructor Summary
| Constructor | Description |
|---|---|
| AuthorizationChallengeHandler(String username, String password) |
Creates an AuthorizationChallengeHandler using the |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
| final String |
attemptToPipelineAuthorization(String method, String uri, Supplier<byte[]> entityBodySupplier)
Attempts to pipeline requests by applying the most recent authorization type used to create an authorization header. |
| final void |
consumeAuthenticationInfoHeader(Map<String,String> authenticationInfoMap)
Consumes either the 'Authentication-Info' or 'Proxy-Authentication-Info' header returned in a response from a server. |
| final String |
handleBasic()
Handles Basic authentication challenges. |
| final String |
handleDigest(String method, String uri, List<Map<String,String>> challenges, Supplier<byte[]> entityBodySupplier)
Handles Digest authentication challenges. |
| static Map<String,String> |
parseAuthenticationOrAuthorizationHeader(String header)
Parses the |
Methods inherited from java.lang.Object
Field Details
AUTHENTICATION_INFO
public static final String AUTHENTICATION_INFO
Header representing additional information a server is expecting during future authentication requests.
AUTHORIZATION
public static final String AUTHORIZATION
Header representing the authorization the client is presenting to a server.
PROXY_AUTHENTICATE
public static final String PROXY_AUTHENTICATE
Header representing a proxy server requesting authentication.
PROXY_AUTHENTICATION_INFO
public static final String PROXY_AUTHENTICATION_INFO
Header representing additional information a proxy server is expecting during future authentication requests.
PROXY_AUTHORIZATION
public static final String PROXY_AUTHORIZATION
Header representing the authorization the client is presenting to a proxy server.
WWW_AUTHENTICATE
public static final String WWW_AUTHENTICATE
Header representing a server requesting authentication.
Constructor Details
AuthorizationChallengeHandler
public AuthorizationChallengeHandler(String username, String password)
Creates an AuthorizationChallengeHandler using the username and password to respond to authentication challenges.
Parameters:
Method Details
attemptToPipelineAuthorization
public final String attemptToPipelineAuthorization(String method, String uri, Supplier<byte[]> entityBodySupplier)
Attempts to pipeline requests by applying the most recent authorization type used to create an authorization header.
Parameters:
"qop=auth-int".
Returns:
consumeAuthenticationInfoHeader
public final void consumeAuthenticationInfoHeader(Map<String,String> authenticationInfoMap)
Consumes either the 'Authentication-Info' or 'Proxy-Authentication-Info' header returned in a response from a server. This header is used by the server to communicate information about the successful authentication of the client, this header may be returned at any time by the server.
See RFC 7615 for more information about these headers.
Parameters:
handleBasic
public final String handleBasic()
Handles Basic authentication challenges.
Returns:
handleDigest
public final String handleDigest(String method, String uri, List<Map<String,String>> challenges, Supplier<byte[]> entityBodySupplier)
Handles Digest authentication challenges.
Parameters:
"qop=auth-int".
Returns:
parseAuthenticationOrAuthorizationHeader
public static Map<String,String> parseAuthenticationOrAuthorizationHeader(String header)
Parses the Authorization or Authentication header into its key-value pairs.
This will remove quotes on quoted string values.
Parameters:
Returns: