public class SocialAuthenticationProvider extends 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 Collection<? extends org.springframework.security.core.GrantedAuthority> |
getAuthorities(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(Class<? extends Object> authentication) |
protected String |
toUserId(Connection<?> connection) |
public SocialAuthenticationProvider(UsersConnectionRepository usersConnectionRepository, SocialUserDetailsService userDetailsService)
public boolean supports(Class<? extends 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 String toUserId(Connection<?> connection)
protected Collection<? extends org.springframework.security.core.GrantedAuthority> getAuthorities(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()