@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 id) |
Set<OAuth2RefreshTokenEntity> |
getAllRefreshTokensForUser(String id) |
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 id)
getAllAccessTokensForUser
in interface OAuth2TokenEntityService
public Set<OAuth2RefreshTokenEntity> getAllRefreshTokensForUser(String id)
getAllRefreshTokensForUser
in interface OAuth2TokenEntityService
public OAuth2AccessTokenEntity getAccessTokenById(Long id)
getAccessTokenById
in interface OAuth2TokenEntityService
public 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.AuthorizationServerTokenServices
org.springframework.security.core.AuthenticationException
org.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.AuthorizationServerTokenServices
org.springframework.security.core.AuthenticationException
public org.springframework.security.oauth2.provider.OAuth2Authentication loadAuthentication(String accessTokenValue) throws org.springframework.security.core.AuthenticationException
loadAuthentication
in interface org.springframework.security.oauth2.provider.token.ResourceServerTokenServices
org.springframework.security.core.AuthenticationException
public OAuth2AccessTokenEntity readAccessToken(String accessTokenValue) throws org.springframework.security.core.AuthenticationException
readAccessToken
in interface OAuth2TokenEntityService
readAccessToken
in interface org.springframework.security.oauth2.provider.token.ResourceServerTokenServices
org.springframework.security.core.AuthenticationException
public OAuth2AccessTokenEntity getAccessToken(org.springframework.security.oauth2.provider.OAuth2Authentication authentication)
getAccessToken
in interface OAuth2TokenEntityService
getAccessToken
in interface org.springframework.security.oauth2.provider.token.AuthorizationServerTokenServices
public OAuth2RefreshTokenEntity getRefreshToken(String refreshTokenValue) throws org.springframework.security.core.AuthenticationException
getRefreshToken
in interface OAuth2TokenEntityService
org.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 OAuth2TokenEntityService
public List<OAuth2AccessTokenEntity> getAccessTokensForClient(ClientDetailsEntity client)
getAccessTokensForClient
in interface OAuth2TokenEntityService
public List<OAuth2RefreshTokenEntity> getRefreshTokensForClient(ClientDetailsEntity client)
getRefreshTokensForClient
in interface OAuth2TokenEntityService
public 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 OAuth2TokenEntityService
public 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 OAuth2TokenEntityService
Copyright © 2018. All rights reserved.