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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.springframework.social.security.provider.SocialAuthenticationService
SocialAuthenticationService.ConnectionCardinality
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.commons.logging.Loglogger
-
Constructor Summary
Constructors Constructor Description OAuth2AuthenticationService(OAuth2ConnectionFactory<S> connectionFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()protected StringbuildReturnToUrl(javax.servlet.http.HttpServletRequest request)SocialAuthenticationTokengetAuthToken(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)extractSocialAuthenticationTokenfrom requestOAuth2ConnectionFactory<S>getConnectionFactory()Set<String>getReturnToUrlParameters()voidsetConnectionFactory(OAuth2ConnectionFactory<S> connectionFactory)voidsetDefaultScope(String defaultScope)voidsetReturnToUrlParameters(Set<String> returnToUrlParameters)-
Methods inherited from class org.springframework.social.security.provider.AbstractSocialAuthenticationService
getConnectionAddedRedirectUrl, getConnectionCardinality, setConnectionAddedRedirectUrl, setConnectionCardinality
-
-
-
-
Constructor Detail
-
OAuth2AuthenticationService
public OAuth2AuthenticationService(OAuth2ConnectionFactory<S> connectionFactory)
-
-
Method Detail
-
getConnectionFactory
public OAuth2ConnectionFactory<S> getConnectionFactory()
- Returns:
ConnectionFactoryused for authentication
-
setConnectionFactory
public void setConnectionFactory(OAuth2ConnectionFactory<S> connectionFactory)
-
setDefaultScope
public void setDefaultScope(String defaultScope)
- Parameters:
defaultScope- OAuth scope to use, i.e. requested permissions
-
afterPropertiesSet
public void afterPropertiesSet() throws Exception- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Overrides:
afterPropertiesSetin classAbstractSocialAuthenticationService<S>- Throws:
Exception
-
getAuthToken
public SocialAuthenticationToken getAuthToken(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws SocialAuthenticationRedirectException
Description copied from interface:SocialAuthenticationServiceextractSocialAuthenticationTokenfrom request- Parameters:
request- currentHttpServletRequestresponse- currentHttpServletResponse- Returns:
- new unauthenticated token or null
- Throws:
SocialAuthenticationRedirectException- if social auth requires a redirect, e.g. OAuth
-
buildReturnToUrl
protected String buildReturnToUrl(javax.servlet.http.HttpServletRequest request)
-
-