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
ConstructorsConstructorDescriptionDefaultOAuth2UserDetailsService
(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 User
findActiveUser
(String username, String clientId) protected String
findServerIdForClient
(String clientId) protected AuthorizedClientService<AuthorizedClient>
protected PrivilegeService
protected UserService<User>
loadAnonymousCsrUser
(String clientId) loadByClientAndUsername
(AuthorizedClient client, String username) protected OAuth2UserDetails
loadByUsernameClientServer
(String username, String clientId, String serverId) 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
-
loadByClientAndUsername
@Transactional(readOnly=true) public OAuth2UserDetails loadByClientAndUsername(AuthorizedClient client, String username) - Specified by:
loadByClientAndUsername
in interfaceOAuth2UserDetailsService
-
loadAnonymousCsrUser
- Specified by:
loadAnonymousCsrUser
in interfaceOAuth2UserDetailsService
-
loadCsrUser
- Specified by:
loadCsrUser
in interfaceOAuth2UserDetailsService
-
loadByUsernameClientServer
protected OAuth2UserDetails loadByUsernameClientServer(String username, String clientId, String serverId) -
findActiveUser
-
findServerIdForClient
-
buildUserDetails
-
createGrantedAuthoritiesFromPermissionNames
-
createAuthority
-
getUserService
-
getClientService
-
getPrivilegeService
-