org.springframework.social.security.provider
Class OAuth2AuthenticationService<S>
java.lang.Object
org.springframework.social.security.provider.AbstractSocialAuthenticationService<S>
org.springframework.social.security.provider.OAuth2AuthenticationService<S>
- Type Parameters:
S
- The provider's API type.
- All Implemented Interfaces:
- org.springframework.beans.factory.InitializingBean, SocialAuthenticationService<S>
public class OAuth2AuthenticationService<S>
- extends AbstractSocialAuthenticationService<S>
- Author:
- Stefan Fussennegger
Field Summary |
protected org.apache.commons.logging.Log |
logger
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
protected final org.apache.commons.logging.Log logger
OAuth2AuthenticationService
public OAuth2AuthenticationService(OAuth2ConnectionFactory<S> connectionFactory)
getConnectionFactory
public OAuth2ConnectionFactory<S> getConnectionFactory()
- Returns:
ConnectionFactory
used for authentication
setConnectionFactory
public void setConnectionFactory(OAuth2ConnectionFactory<S> connectionFactory)
setReturnToUrlParameters
public void setReturnToUrlParameters(java.util.Set<java.lang.String> returnToUrlParameters)
getReturnToUrlParameters
public java.util.Set<java.lang.String> getReturnToUrlParameters()
setDefaultScope
public void setDefaultScope(java.lang.String defaultScope)
- Parameters:
defaultScope
- OAuth scope to use, i.e. requested permissions
afterPropertiesSet
public void afterPropertiesSet()
throws java.lang.Exception
- Specified by:
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
- Overrides:
afterPropertiesSet
in class AbstractSocialAuthenticationService<S>
- Throws:
java.lang.Exception
getAuthToken
public SocialAuthenticationToken getAuthToken(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws SocialAuthenticationRedirectException
- Description copied from interface:
SocialAuthenticationService
- extract
SocialAuthenticationToken
from request
- Parameters:
request
- current HttpServletRequest
response
- current HttpServletResponse
- Returns:
- new unauthenticated token or null
- Throws:
SocialAuthenticationRedirectException
- if social auth requires a redirect, e.g. OAuth
buildReturnToUrl
protected java.lang.String buildReturnToUrl(javax.servlet.http.HttpServletRequest request)