Class SocialAuthenticationProvider
- java.lang.Object
-
- org.springframework.social.security.SocialAuthenticationProvider
-
- All Implemented Interfaces:
org.springframework.security.authentication.AuthenticationProvider
public class SocialAuthenticationProvider extends Object implements org.springframework.security.authentication.AuthenticationProvider
AuthenticationProviderfor spring-social basedServiceProviders- Author:
- Stefan Fussennegger, Yuan Ji
-
-
Constructor Summary
Constructors Constructor Description SocialAuthenticationProvider(UsersConnectionRepository usersConnectionRepository, SocialUserDetailsService userDetailsService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.security.core.Authenticationauthenticate(org.springframework.security.core.Authentication authentication)Authenticate user based onSocialAuthenticationTokenprotected Collection<? extends org.springframework.security.core.GrantedAuthority>getAuthorities(String providerId, org.springframework.security.core.userdetails.UserDetails userDetails)Override to grant authorities based onServiceProviderid and/or a user's account idbooleansupports(Class<? extends Object> authentication)protected StringtoUserId(Connection<?> connection)
-
-
-
Constructor Detail
-
SocialAuthenticationProvider
public SocialAuthenticationProvider(UsersConnectionRepository usersConnectionRepository, SocialUserDetailsService userDetailsService)
-
-
Method Detail
-
supports
public boolean supports(Class<? extends Object> authentication)
- Specified by:
supportsin interfaceorg.springframework.security.authentication.AuthenticationProvider
-
authenticate
public org.springframework.security.core.Authentication authenticate(org.springframework.security.core.Authentication authentication) throws org.springframework.security.core.AuthenticationExceptionAuthenticate user based onSocialAuthenticationToken- Specified by:
authenticatein interfaceorg.springframework.security.authentication.AuthenticationProvider- Throws:
org.springframework.security.core.AuthenticationException
-
toUserId
protected String toUserId(Connection<?> connection)
-
getAuthorities
protected Collection<? extends org.springframework.security.core.GrantedAuthority> getAuthorities(String providerId, org.springframework.security.core.userdetails.UserDetails userDetails)
Override to grant authorities based onServiceProviderid and/or a user's account id- Parameters:
providerId-ServiceProvideriduserDetails-UserDetailsas returned bySocialUserDetailsService- Returns:
- extra authorities of this user not already returned by
UserDetails.getAuthorities()
-
-