org.springframework.security.oauth2.client.token
Class OAuth2AccessTokenSupport

java.lang.Object
  extended by org.springframework.security.oauth2.client.token.OAuth2AccessTokenSupport
Direct Known Subclasses:
AccessTokenProviderChain, AuthorizationCodeAccessTokenProvider, ClientCredentialsAccessTokenProvider, ImplicitAccessTokenProvider, ResourceOwnerPasswordAccessTokenProvider

public abstract class OAuth2AccessTokenSupport
extends Object

Base support logic for obtaining access tokens.

Author:
Ryan Heaton, Dave Syer

Field Summary
protected  Log logger
           
 
Constructor Summary
OAuth2AccessTokenSupport()
           
 
Method Summary
protected  String getAccessTokenUri(OAuth2ProtectedResourceDetails resource, MultiValueMap<String,String> form)
           
protected  org.springframework.http.HttpMethod getHttpMethod()
           
protected  org.springframework.web.client.RequestCallback getRequestCallback(OAuth2ProtectedResourceDetails resource, MultiValueMap<String,String> form, org.springframework.http.HttpHeaders headers)
           
protected  org.springframework.web.client.ResponseErrorHandler getResponseErrorHandler()
           
protected  org.springframework.web.client.ResponseExtractor<OAuth2AccessToken> getResponseExtractor()
           
protected  org.springframework.web.client.RestOperations getRestTemplate()
           
protected  OAuth2AccessToken retrieveToken(MultiValueMap<String,String> form, org.springframework.http.HttpHeaders headers, OAuth2ProtectedResourceDetails resource)
           
 void setAuthenticationHandler(ClientAuthenticationHandler authenticationHandler)
           
 void setMessageConverters(List<org.springframework.http.converter.HttpMessageConverter<?>> messageConverters)
           
 void setRequestFactory(org.springframework.http.client.ClientHttpRequestFactory requestFactory)
          Set the request factory that this template uses for obtaining HttpRequests.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final Log logger
Constructor Detail

OAuth2AccessTokenSupport

public OAuth2AccessTokenSupport()
Method Detail

getRestTemplate

protected org.springframework.web.client.RestOperations getRestTemplate()

setAuthenticationHandler

public void setAuthenticationHandler(ClientAuthenticationHandler authenticationHandler)

setMessageConverters

public void setMessageConverters(List<org.springframework.http.converter.HttpMessageConverter<?>> messageConverters)

retrieveToken

protected OAuth2AccessToken retrieveToken(MultiValueMap<String,String> form,
                                          org.springframework.http.HttpHeaders headers,
                                          OAuth2ProtectedResourceDetails resource)
                                   throws OAuth2AccessDeniedException
Throws:
OAuth2AccessDeniedException

getHttpMethod

protected org.springframework.http.HttpMethod getHttpMethod()

getAccessTokenUri

protected String getAccessTokenUri(OAuth2ProtectedResourceDetails resource,
                                   MultiValueMap<String,String> form)

getResponseErrorHandler

protected org.springframework.web.client.ResponseErrorHandler getResponseErrorHandler()

setRequestFactory

public void setRequestFactory(org.springframework.http.client.ClientHttpRequestFactory requestFactory)
Set the request factory that this template uses for obtaining HttpRequests.


getResponseExtractor

protected org.springframework.web.client.ResponseExtractor<OAuth2AccessToken> getResponseExtractor()

getRequestCallback

protected org.springframework.web.client.RequestCallback getRequestCallback(OAuth2ProtectedResourceDetails resource,
                                                                            MultiValueMap<String,String> form,
                                                                            org.springframework.http.HttpHeaders headers)


Copyright © 2012. All Rights Reserved.