@Service(value="defaultOAuth2ProviderTokenService") public class DefaultOAuth2ProviderTokenService extends Object implements OAuth2TokenEntityService
| Constructor and Description |
|---|
DefaultOAuth2ProviderTokenService() |
| Modifier and Type | Method and Description |
|---|---|
void |
clearExpiredTokens()
Clears out expired tokens and any abandoned authentication objects
|
OAuth2AccessTokenEntity |
createAccessToken(org.springframework.security.oauth2.provider.OAuth2Authentication authentication) |
OAuth2AccessTokenEntity |
getAccessToken(org.springframework.security.oauth2.provider.OAuth2Authentication authentication)
Get an access token by its authentication object.
|
OAuth2AccessTokenEntity |
getAccessTokenById(Long id) |
List<OAuth2AccessTokenEntity> |
getAccessTokensForClient(ClientDetailsEntity client) |
Set<OAuth2AccessTokenEntity> |
getAllAccessTokensForUser(String userName) |
Set<OAuth2RefreshTokenEntity> |
getAllRefreshTokensForUser(String userName) |
OAuth2RefreshTokenEntity |
getRefreshToken(String refreshTokenValue)
Get a refresh token by its token value.
|
OAuth2RefreshTokenEntity |
getRefreshTokenById(Long id) |
List<OAuth2RefreshTokenEntity> |
getRefreshTokensForClient(ClientDetailsEntity client) |
OAuth2AccessTokenEntity |
getRegistrationAccessTokenForClient(ClientDetailsEntity client) |
org.springframework.security.oauth2.provider.token.TokenEnhancer |
getTokenEnhancer() |
org.springframework.security.oauth2.provider.OAuth2Authentication |
loadAuthentication(String accessTokenValue) |
OAuth2AccessTokenEntity |
readAccessToken(String accessTokenValue)
Get an access token from its token value.
|
OAuth2AccessTokenEntity |
refreshAccessToken(String refreshTokenValue,
org.springframework.security.oauth2.provider.TokenRequest authRequest) |
void |
revokeAccessToken(OAuth2AccessTokenEntity accessToken)
Revoke an access token.
|
void |
revokeRefreshToken(OAuth2RefreshTokenEntity refreshToken)
Revoke a refresh token and all access tokens issued to it.
|
OAuth2AccessTokenEntity |
saveAccessToken(OAuth2AccessTokenEntity accessToken) |
OAuth2RefreshTokenEntity |
saveRefreshToken(OAuth2RefreshTokenEntity refreshToken) |
void |
setTokenEnhancer(org.springframework.security.oauth2.provider.token.TokenEnhancer tokenEnhancer) |
public DefaultOAuth2ProviderTokenService()
public Set<OAuth2AccessTokenEntity> getAllAccessTokensForUser(String userName)
getAllAccessTokensForUser in interface OAuth2TokenEntityServicepublic Set<OAuth2RefreshTokenEntity> getAllRefreshTokensForUser(String userName)
getAllRefreshTokensForUser in interface OAuth2TokenEntityServicepublic OAuth2AccessTokenEntity getAccessTokenById(Long id)
getAccessTokenById in interface OAuth2TokenEntityServicepublic OAuth2RefreshTokenEntity getRefreshTokenById(Long id)
getRefreshTokenById in interface OAuth2TokenEntityService@Transactional(value="defaultTransactionManager") public OAuth2AccessTokenEntity createAccessToken(org.springframework.security.oauth2.provider.OAuth2Authentication authentication) throws org.springframework.security.core.AuthenticationException, org.springframework.security.oauth2.common.exceptions.InvalidClientException
createAccessToken in interface org.springframework.security.oauth2.provider.token.AuthorizationServerTokenServicesorg.springframework.security.core.AuthenticationExceptionorg.springframework.security.oauth2.common.exceptions.InvalidClientException@Transactional(value="defaultTransactionManager") public OAuth2AccessTokenEntity refreshAccessToken(String refreshTokenValue, org.springframework.security.oauth2.provider.TokenRequest authRequest) throws org.springframework.security.core.AuthenticationException
refreshAccessToken in interface org.springframework.security.oauth2.provider.token.AuthorizationServerTokenServicesorg.springframework.security.core.AuthenticationExceptionpublic org.springframework.security.oauth2.provider.OAuth2Authentication loadAuthentication(String accessTokenValue) throws org.springframework.security.core.AuthenticationException
loadAuthentication in interface org.springframework.security.oauth2.provider.token.ResourceServerTokenServicesorg.springframework.security.core.AuthenticationExceptionpublic OAuth2AccessTokenEntity readAccessToken(String accessTokenValue) throws org.springframework.security.core.AuthenticationException
readAccessToken in interface OAuth2TokenEntityServicereadAccessToken in interface org.springframework.security.oauth2.provider.token.ResourceServerTokenServicesorg.springframework.security.core.AuthenticationExceptionpublic OAuth2AccessTokenEntity getAccessToken(org.springframework.security.oauth2.provider.OAuth2Authentication authentication)
getAccessToken in interface OAuth2TokenEntityServicegetAccessToken in interface org.springframework.security.oauth2.provider.token.AuthorizationServerTokenServicespublic OAuth2RefreshTokenEntity getRefreshToken(String refreshTokenValue) throws org.springframework.security.core.AuthenticationException
getRefreshToken in interface OAuth2TokenEntityServiceorg.springframework.security.core.AuthenticationException@Transactional(value="defaultTransactionManager") public void revokeRefreshToken(OAuth2RefreshTokenEntity refreshToken)
revokeRefreshToken in interface OAuth2TokenEntityService@Transactional(value="defaultTransactionManager") public void revokeAccessToken(OAuth2AccessTokenEntity accessToken)
revokeAccessToken in interface OAuth2TokenEntityServicepublic List<OAuth2AccessTokenEntity> getAccessTokensForClient(ClientDetailsEntity client)
getAccessTokensForClient in interface OAuth2TokenEntityServicepublic List<OAuth2RefreshTokenEntity> getRefreshTokensForClient(ClientDetailsEntity client)
getRefreshTokensForClient in interface OAuth2TokenEntityServicepublic void clearExpiredTokens()
clearExpiredTokens in interface OAuth2TokenEntityService@Transactional(value="defaultTransactionManager") public OAuth2AccessTokenEntity saveAccessToken(OAuth2AccessTokenEntity accessToken)
saveAccessToken in interface OAuth2TokenEntityService@Transactional(value="defaultTransactionManager") public OAuth2RefreshTokenEntity saveRefreshToken(OAuth2RefreshTokenEntity refreshToken)
saveRefreshToken in interface OAuth2TokenEntityServicepublic org.springframework.security.oauth2.provider.token.TokenEnhancer getTokenEnhancer()
public void setTokenEnhancer(org.springframework.security.oauth2.provider.token.TokenEnhancer tokenEnhancer)
tokenEnhancer - the tokenEnhancer to setpublic OAuth2AccessTokenEntity getRegistrationAccessTokenForClient(ClientDetailsEntity client)
getRegistrationAccessTokenForClient in interface OAuth2TokenEntityServiceCopyright © 2022. All rights reserved.