|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.http.client.support.HttpAccessor
org.springframework.http.client.support.InterceptingHttpAccessor
org.springframework.web.client.RestTemplate
org.springframework.security.oauth2.client.OAuth2RestTemplate
public class OAuth2RestTemplate
Rest template that is able to make OAuth2-authenticated REST requests with the credentials of the provided resource.
| Field Summary |
|---|
| Fields inherited from class org.springframework.http.client.support.HttpAccessor |
|---|
logger |
| Constructor Summary | |
|---|---|
OAuth2RestTemplate(OAuth2ProtectedResourceDetails resource)
|
|
OAuth2RestTemplate(OAuth2ProtectedResourceDetails resource,
OAuth2ClientContext context)
|
|
| Method Summary | ||
|---|---|---|
protected OAuth2AccessToken |
acquireAccessToken(OAuth2ClientContext oauth2Context)
|
|
protected URI |
appendQueryParameter(URI uri,
OAuth2AccessToken accessToken)
|
|
protected org.springframework.http.client.ClientHttpRequest |
createRequest(URI uri,
org.springframework.http.HttpMethod method)
|
|
protected
|
doExecute(URI url,
org.springframework.http.HttpMethod method,
org.springframework.web.client.RequestCallback requestCallback,
org.springframework.web.client.ResponseExtractor<T> responseExtractor)
|
|
OAuth2AccessToken |
getAccessToken()
Acquire or renew an access token for the current context if necessary. |
|
OAuth2ClientContext |
getOAuth2ClientContext()
|
|
void |
setAccessTokenProvider(AccessTokenProvider accessTokenProvider)
|
|
void |
setErrorHandler(org.springframework.web.client.ResponseErrorHandler errorHandler)
|
|
void |
setRetryBadAccessTokens(boolean retryBadAccessTokens)
Flag to determine whether a request that has an existing access token, and which then leads to an AccessTokenRequiredException should be retried (immediately, once). |
|
| Methods inherited from class org.springframework.web.client.RestTemplate |
|---|
delete, delete, delete, exchange, exchange, exchange, exchange, exchange, exchange, execute, execute, execute, getErrorHandler, getForEntity, getForEntity, getForEntity, getForObject, getForObject, getForObject, getMessageConverters, headForHeaders, headForHeaders, headForHeaders, optionsForAllow, optionsForAllow, optionsForAllow, postForEntity, postForEntity, postForEntity, postForLocation, postForLocation, postForLocation, postForObject, postForObject, postForObject, put, put, put, setMessageConverters |
| Methods inherited from class org.springframework.http.client.support.InterceptingHttpAccessor |
|---|
getInterceptors, getRequestFactory, setInterceptors |
| Methods inherited from class org.springframework.http.client.support.HttpAccessor |
|---|
setRequestFactory |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.springframework.web.client.RestOperations |
|---|
delete, delete, delete, exchange, exchange, exchange, exchange, exchange, exchange, execute, execute, execute, getForEntity, getForEntity, getForEntity, getForObject, getForObject, getForObject, headForHeaders, headForHeaders, headForHeaders, optionsForAllow, optionsForAllow, optionsForAllow, postForEntity, postForEntity, postForEntity, postForLocation, postForLocation, postForLocation, postForObject, postForObject, postForObject, put, put, put |
| Constructor Detail |
|---|
public OAuth2RestTemplate(OAuth2ProtectedResourceDetails resource)
public OAuth2RestTemplate(OAuth2ProtectedResourceDetails resource,
OAuth2ClientContext context)
| Method Detail |
|---|
public void setRetryBadAccessTokens(boolean retryBadAccessTokens)
retryBadAccessTokens - the flag to set (default true)public void setErrorHandler(org.springframework.web.client.ResponseErrorHandler errorHandler)
setErrorHandler in class org.springframework.web.client.RestTemplate
protected org.springframework.http.client.ClientHttpRequest createRequest(URI uri,
org.springframework.http.HttpMethod method)
throws IOException
createRequest in class org.springframework.http.client.support.HttpAccessorIOException
protected <T> T doExecute(URI url,
org.springframework.http.HttpMethod method,
org.springframework.web.client.RequestCallback requestCallback,
org.springframework.web.client.ResponseExtractor<T> responseExtractor)
throws org.springframework.web.client.RestClientException
doExecute in class org.springframework.web.client.RestTemplateorg.springframework.web.client.RestClientException
public OAuth2AccessToken getAccessToken()
throws UserRedirectRequiredException
getAccessToken in interface OAuth2RestOperationsUserRedirectRequiredExceptionpublic OAuth2ClientContext getOAuth2ClientContext()
getOAuth2ClientContext in interface OAuth2RestOperations
protected OAuth2AccessToken acquireAccessToken(OAuth2ClientContext oauth2Context)
throws UserRedirectRequiredException
UserRedirectRequiredException
protected URI appendQueryParameter(URI uri,
OAuth2AccessToken accessToken)
public void setAccessTokenProvider(AccessTokenProvider accessTokenProvider)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||