@Service @Transactional(readOnly=true) public class OAuthServiceImpl extends Object implements OAuthClientDetailsService
| Modifier and Type | Field and Description |
|---|---|
org.springframework.security.crypto.password.PasswordEncoder |
passwordEncoder
The password encoder.
|
| Constructor and Description |
|---|
OAuthServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
OAuthClient |
addClient(OAuthClient client)
Register a new OAuth client.
|
List<OAuthClient> |
autocompleteClients(String term,
int limit)
Autocomplete OAuth clients by title.
|
OAuthClient |
getClient(String clientId)
Gets the client.
|
List<OAuthClient> |
listClientDetails()
List client details.
|
org.springframework.data.domain.Page<OAuthClient> |
listClientDetails(org.springframework.data.domain.Pageable pageable)
List client details.
|
org.springframework.security.oauth2.provider.ClientDetails |
loadClientByClientId(String clientId) |
OAuthClient |
removeClient(OAuthClient client)
Removes the client.
|
OAuthClient |
removeSecret(OAuthClient oauthClient)
Removes the Client secret.
|
String |
resetSecret(OAuthClient oauthClient)
Generates a new clientSecret.
|
OAuthClient |
updateClient(long id,
int version,
OAuthClient updates)
Update client.
|
@Autowired public org.springframework.security.crypto.password.PasswordEncoder passwordEncoder
@Cacheable(cacheNames="oauthclient",
key="#clientId",
unless="#result == null")
public org.springframework.security.oauth2.provider.ClientDetails loadClientByClientId(String clientId)
throws org.springframework.security.oauth2.provider.ClientRegistrationException
loadClientByClientId in interface org.springframework.security.oauth2.provider.ClientDetailsServiceorg.springframework.security.oauth2.provider.ClientRegistrationExceptionpublic List<OAuthClient> listClientDetails()
OAuthClientDetailsServicelistClientDetails in interface OAuthClientDetailsServicepublic org.springframework.data.domain.Page<OAuthClient> listClientDetails(org.springframework.data.domain.Pageable pageable)
OAuthClientDetailsServicelistClientDetails in interface OAuthClientDetailsServicepageable - the pageablepublic OAuthClient getClient(String clientId)
OAuthClientDetailsServicegetClient in interface OAuthClientDetailsServiceclientId - the client id@Transactional
@CacheEvict(cacheNames="oauthclient",
key="#client.clientId",
condition="#client != null")
public OAuthClient removeClient(OAuthClient client)
OAuthClientDetailsServiceremoveClient in interface OAuthClientDetailsServiceclient - the oauth client@Transactional public OAuthClient addClient(OAuthClient client)
OAuthClientDetailsServiceaddClient in interface OAuthClientDetailsServiceclient - the client@Transactional
@CacheEvict(cacheNames="oauthclient",
key="#updates.clientId",
condition="#updates != null")
public OAuthClient updateClient(long id,
int version,
OAuthClient updates)
OAuthClientDetailsServiceupdateClient in interface OAuthClientDetailsServiceid - the idversion - the versionupdates - the updatespublic List<OAuthClient> autocompleteClients(String term, int limit)
OAuthClientDetailsServiceautocompleteClients in interface OAuthClientDetailsServiceterm - the titlelimit - maximum number of results@Transactional @PreAuthorize(value="hasRole(\'ADMINISTRATOR\') or hasPermission(#oauthClient, \'ADMINISTRATION\')") public final String resetSecret(OAuthClient oauthClient)
OAuthClientDetailsServiceresetSecret in interface OAuthClientDetailsServiceoauthClient - the client to regenerate secret for@Transactional @PreAuthorize(value="hasRole(\'ADMINISTRATOR\') or hasPermission(#oauthClient, \'ADMINISTRATION\')") public final OAuthClient removeSecret(OAuthClient oauthClient)
OAuthClientDetailsServiceremoveSecret in interface OAuthClientDetailsServiceoauthClient - the oauth clientCopyright © 2020 Global Crop Diversity Trust. All rights reserved.