Class DefaultOAuth2UserDetailsService
- java.lang.Object
-
- com.broadleafcommerce.auth.user.service.DefaultOAuth2UserDetailsService
-
- All Implemented Interfaces:
OAuth2UserDetailsService
public class DefaultOAuth2UserDetailsService extends Object implements OAuth2UserDetailsService
AnOAuth2UserDetailsService
implementation that uses theUserService
for loading users by clientId and username.- Author:
- Nathan Moore (nathanmoore), Phillip Verheyden (phillipuniverse), Nick Crum (ncrum)
-
-
Constructor Summary
Constructors Constructor Description DefaultOAuth2UserDetailsService(UserService<User> userService, AuthorizedClientService<AuthorizedClient> clientService, PrivilegeService privilegeService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected OAuth2UserDetails
buildUserDetails(User user, String clientId, String serverId)
protected org.springframework.security.core.GrantedAuthority
createAuthority(String raw)
protected Set<org.springframework.security.core.GrantedAuthority>
createGrantedAuthoritiesFromPermissionNames(Set<String> permissionNames)
protected String
findServerIdForClient(String clientId)
OAuth2UserDetails
loadAnonymousCsrUser(String clientId)
OAuth2UserDetails
loadUserByClientIdAndUsername(String clientId, String username)
boolean
usernameExists(String clientId, String username)
-
-
-
Constructor Detail
-
DefaultOAuth2UserDetailsService
public DefaultOAuth2UserDetailsService(UserService<User> userService, AuthorizedClientService<AuthorizedClient> clientService, PrivilegeService privilegeService)
-
-
Method Detail
-
usernameExists
@Transactional(readOnly=true) public boolean usernameExists(String clientId, String username)
- Specified by:
usernameExists
in interfaceOAuth2UserDetailsService
-
loadUserByClientIdAndUsername
@Transactional(readOnly=true) public OAuth2UserDetails loadUserByClientIdAndUsername(String clientId, String username)
- Specified by:
loadUserByClientIdAndUsername
in interfaceOAuth2UserDetailsService
-
loadAnonymousCsrUser
public OAuth2UserDetails loadAnonymousCsrUser(String clientId)
- Specified by:
loadAnonymousCsrUser
in interfaceOAuth2UserDetailsService
-
buildUserDetails
protected OAuth2UserDetails buildUserDetails(User user, String clientId, String serverId)
-
createGrantedAuthoritiesFromPermissionNames
protected Set<org.springframework.security.core.GrantedAuthority> createGrantedAuthoritiesFromPermissionNames(Set<String> permissionNames)
-
createAuthority
protected org.springframework.security.core.GrantedAuthority createAuthority(String raw)
-
-