public class SocialAuthenticationProvider
extends java.lang.Object
implements org.springframework.security.authentication.AuthenticationProvider
AuthenticationProvider for spring-social based ServiceProviders| Constructor and Description |
|---|
SocialAuthenticationProvider(UsersConnectionRepository usersConnectionRepository,
SocialUserDetailsService userDetailsService) |
| Modifier and Type | Method and Description |
|---|---|
org.springframework.security.core.Authentication |
authenticate(org.springframework.security.core.Authentication authentication)
Authenticate user based on
SocialAuthenticationToken |
protected java.util.Collection<? extends org.springframework.security.core.GrantedAuthority> |
getAuthorities(java.lang.String providerId,
org.springframework.security.core.userdetails.UserDetails userDetails)
Override to grant authorities based on
ServiceProvider id and/or a user's account id |
boolean |
supports(java.lang.Class<? extends java.lang.Object> authentication) |
protected java.lang.String |
toUserId(Connection<?> connection) |
public SocialAuthenticationProvider(UsersConnectionRepository usersConnectionRepository, SocialUserDetailsService userDetailsService)
public boolean supports(java.lang.Class<? extends java.lang.Object> authentication)
supports in interface org.springframework.security.authentication.AuthenticationProviderpublic org.springframework.security.core.Authentication authenticate(org.springframework.security.core.Authentication authentication)
throws org.springframework.security.core.AuthenticationException
SocialAuthenticationTokenauthenticate in interface org.springframework.security.authentication.AuthenticationProviderorg.springframework.security.core.AuthenticationExceptionprotected java.lang.String toUserId(Connection<?> connection)
protected java.util.Collection<? extends org.springframework.security.core.GrantedAuthority> getAuthorities(java.lang.String providerId,
org.springframework.security.core.userdetails.UserDetails userDetails)
ServiceProvider id and/or a user's account idproviderId - ServiceProvider iduserDetails - UserDetails as returned by SocialUserDetailsServiceUserDetails.getAuthorities()