public class DigestAuthRestTemplate
extends org.springframework.web.client.RestTemplate
| Modifier and Type | Class and Description |
|---|---|
protected static class |
DigestAuthRestTemplate.DigestRequestCallback
RequestCallback wrapper that adds the digest solution header to the request headers
|
protected static class |
DigestAuthRestTemplate.DigestResponseErrorHandler
ResponseErrorHandler wrapper that handles the HTTP 401 Unauthorized errors
|
protected static class |
DigestAuthRestTemplate.UnauthorizedException
Exception thrown by the DigestResponseErrorHandler when HTTP 401 Unauthorized occurs
|
| Constructor and Description |
|---|
DigestAuthRestTemplate(org.apache.http.auth.Credentials credentials)
Constructor with a set of credentials.
|
DigestAuthRestTemplate(String username,
String password)
Convenience constructor from user name and password; will use the same credentials for all requests.
|
| Modifier and Type | Method and Description |
|---|---|
protected org.apache.http.Header |
createSolution(URI url,
org.springframework.http.HttpMethod method,
String challenge)
Creates the digest solution of an authentication challenge
|
protected <T> T |
doExecute(URI url,
org.springframework.http.HttpMethod method,
org.springframework.web.client.RequestCallback pRequestCallback,
org.springframework.web.client.ResponseExtractor<T> responseExtractor) |
void |
setErrorHandler(org.springframework.web.client.ResponseErrorHandler errorHandler) |
acceptHeaderRequestCallback, delete, delete, delete, exchange, exchange, exchange, exchange, exchange, exchange, exchange, exchange, execute, execute, execute, getErrorHandler, getForEntity, getForEntity, getForEntity, getForObject, getForObject, getForObject, getMessageConverters, getUriTemplateHandler, handleResponse, headersExtractor, headForHeaders, headForHeaders, headForHeaders, httpEntityCallback, httpEntityCallback, optionsForAllow, optionsForAllow, optionsForAllow, patchForObject, patchForObject, patchForObject, postForEntity, postForEntity, postForEntity, postForLocation, postForLocation, postForLocation, postForObject, postForObject, postForObject, put, put, put, responseEntityExtractor, setDefaultUriVariables, setMessageConverters, setUriTemplateHandlergetInterceptors, getRequestFactory, setInterceptors, setRequestFactorypublic DigestAuthRestTemplate(org.apache.http.auth.Credentials credentials)
credentials - the set of credentials, consisting of a security principal and a secret (password)public void setErrorHandler(org.springframework.web.client.ResponseErrorHandler errorHandler)
setErrorHandler in class org.springframework.web.client.RestTemplateprotected <T> T doExecute(URI url, org.springframework.http.HttpMethod method, org.springframework.web.client.RequestCallback pRequestCallback, org.springframework.web.client.ResponseExtractor<T> responseExtractor)
doExecute in class org.springframework.web.client.RestTemplateprotected org.apache.http.Header createSolution(URI url, org.springframework.http.HttpMethod method, String challenge) throws org.apache.http.auth.MalformedChallengeException, org.apache.http.auth.AuthenticationException
url - the fully-expanded URL to connect tomethod - the HTTP method to execute (GET, POST, etc.)challenge - the challenge of the HTTP 401 Unauthorized responseorg.apache.http.auth.MalformedChallengeException - if the authentication challenge is malformedorg.apache.http.auth.AuthenticationException - if authorization string cannot be generatedCopyright © 2017–2020 NTT DATA Corporation. All rights reserved.