Spring Social

org.springframework.social.security.provider
Class OAuth2AuthenticationService<S>

java.lang.Object
  extended by org.springframework.social.security.provider.AbstractSocialAuthenticationService<S>
      extended by 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

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.springframework.social.security.provider.SocialAuthenticationService
SocialAuthenticationService.ConnectionCardinality
 
Field Summary
protected  org.apache.commons.logging.Log logger
           
 
Constructor Summary
OAuth2AuthenticationService(OAuth2ConnectionFactory<S> connectionFactory)
           
 
Method Summary
 void afterPropertiesSet()
           
protected  java.lang.String buildReturnToUrl(javax.servlet.http.HttpServletRequest request)
           
 SocialAuthenticationToken getAuthToken(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          extract SocialAuthenticationToken from request
 OAuth2ConnectionFactory<S> getConnectionFactory()
           
 java.util.Set<java.lang.String> getReturnToUrlParameters()
           
 void setConnectionFactory(OAuth2ConnectionFactory<S> connectionFactory)
           
 void setDefaultScope(java.lang.String defaultScope)
           
 void setReturnToUrlParameters(java.util.Set<java.lang.String> returnToUrlParameters)
           
 
Methods inherited from class org.springframework.social.security.provider.AbstractSocialAuthenticationService
getConnectionAddedRedirectUrl, getConnectionCardinality, setConnectionAddedRedirectUrl, setConnectionCardinality
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.apache.commons.logging.Log logger
Constructor Detail

OAuth2AuthenticationService

public OAuth2AuthenticationService(OAuth2ConnectionFactory<S> connectionFactory)
Method Detail

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)

Spring Social