Class DefaultOAuth2UserDetailsService
java.lang.Object
com.broadleafcommerce.auth.user.service.DefaultOAuth2UserDetailsService
- All Implemented Interfaces:
OAuth2UserDetailsService
An
OAuth2UserDetailsService
implementation that uses the UserService
for loading
users by clientId and username.- Author:
- Nathan Moore (nathanmoore), Phillip Verheyden (phillipuniverse), Nick Crum (ncrum)
-
Constructor Summary
ConstructorDescriptionDefaultOAuth2UserDetailsService
(UserService<User> userService, AuthorizedClientService<AuthorizedClient> clientService, PrivilegeService privilegeService) -
Method Summary
Modifier and TypeMethodDescriptionprotected 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) protected AuthorizedClientService<AuthorizedClient>
protected PrivilegeService
protected UserService<User>
loadAnonymousCsrUser
(String clientId) loadCsrUser
(String clientId, String csrId) loadUserByClientIdAndUsername
(String clientId, String username) boolean
usernameExists
(String clientId, String username)
-
Constructor Details
-
DefaultOAuth2UserDetailsService
public DefaultOAuth2UserDetailsService(UserService<User> userService, AuthorizedClientService<AuthorizedClient> clientService, PrivilegeService privilegeService)
-
-
Method Details
-
usernameExists
- Specified by:
usernameExists
in interfaceOAuth2UserDetailsService
-
loadUserByClientIdAndUsername
@Transactional(readOnly=true) public OAuth2UserDetails loadUserByClientIdAndUsername(String clientId, String username) - Specified by:
loadUserByClientIdAndUsername
in interfaceOAuth2UserDetailsService
-
loadAnonymousCsrUser
- Specified by:
loadAnonymousCsrUser
in interfaceOAuth2UserDetailsService
-
loadCsrUser
- Specified by:
loadCsrUser
in interfaceOAuth2UserDetailsService
-
findServerIdForClient
-
buildUserDetails
-
createGrantedAuthoritiesFromPermissionNames
-
createAuthority
-
getUserService
-
getClientService
-
getPrivilegeService
-