public class SocialAuthenticationProvider extends Object implements org.springframework.security.authentication.AuthenticationProvider
AuthenticationProvider
for spring-social based ServiceProvider
sConstructor 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.AuthenticationProvider
public org.springframework.security.core.Authentication authenticate(org.springframework.security.core.Authentication authentication) throws org.springframework.security.core.AuthenticationException
SocialAuthenticationToken
authenticate
in interface org.springframework.security.authentication.AuthenticationProvider
org.springframework.security.core.AuthenticationException
protected 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 SocialUserDetailsService
UserDetails.getAuthorities()