public abstract class AbstractOAuthDataProvider extends Object implements OAuthDataProvider, ClientRegistrationProvider
Modifier | Constructor and Description |
---|---|
protected |
AbstractOAuthDataProvider() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAccessToken, getAccessTokens, getRefreshTokens
getClients, setClient
public ServerAccessToken createAccessToken(AccessTokenRegistration reg) throws OAuthServiceException
OAuthDataProvider
createAccessToken
in interface OAuthDataProvider
reg
- the token registration infoOAuthServiceException
protected ServerAccessToken doCreateAccessToken(AccessTokenRegistration atReg)
protected JwtClaims createJwtAccessToken(ServerAccessToken at)
protected ServerAccessToken createNewAccessToken(Client client, UserSubject userSub)
public ServerAccessToken refreshAccessToken(Client client, String refreshTokenKey, List<String> restrictedScopes) throws OAuthServiceException
OAuthDataProvider
refreshAccessToken
in interface OAuthDataProvider
client
- the clientrefreshTokenKey
- refresh token keyrestrictedScopes
- the scopes requested by the clientOAuthServiceException
public void revokeToken(Client client, String tokenKey, String tokenTypeHint) throws OAuthServiceException
OAuthDataProvider
revokeToken
in interface OAuthDataProvider
client
- the clienttokenKey
- token identifiertokenTypeHint
- can be access_token or refresh_token or nullOAuthServiceException
protected void handleLinkedRefreshToken(Client client, ServerAccessToken accessToken)
protected void revokeAccessTokens(Client client, RefreshToken currentRefreshToken)
protected void unlinkRefreshAccessToken(RefreshToken rt, String tokenKey)
public List<OAuthPermission> convertScopeToPermissions(Client client, List<String> requestedScopes)
OAuthDataProvider
convertScopeToPermissions
in interface OAuthDataProvider
requestedScopes
- the scopesprotected void checkRequestedScopes(Client client, List<String> requestedScopes)
protected void convertSingleScopeToPermission(Client client, String scope, List<OAuthPermission> perms)
public ServerAccessToken getPreauthorizedToken(Client client, List<String> requestedScopes, UserSubject sub, String grantType) throws OAuthServiceException
OAuthDataProvider
getPreauthorizedToken
in interface OAuthDataProvider
client
- ClientrequestedScopes
- the scopes requested by the clientsub
- End User subjectOAuthServiceException
protected String getCurrentRequestedGrantType()
protected String getCurrentClientSecret()
protected javax.ws.rs.core.MultivaluedMap<String,String> getCurrentTokenRequestParams()
protected RefreshToken updateExistingRefreshToken(RefreshToken rt, ServerAccessToken at)
protected RefreshToken updateRefreshToken(RefreshToken rt, ServerAccessToken at)
protected RefreshToken createNewRefreshToken(ServerAccessToken at)
protected RefreshToken doCreateNewRefreshToken(ServerAccessToken at)
protected void linkAccessTokenToRefreshToken(RefreshToken rt, ServerAccessToken at)
protected void linkRefreshTokenToAccessToken(RefreshToken rt, ServerAccessToken at)
protected ServerAccessToken doRefreshAccessToken(Client client, RefreshToken oldRefreshToken, List<String> restrictedScopes)
public void setAccessTokenLifetime(long accessTokenLifetime)
public void setRefreshTokenLifetime(long refreshTokenLifetime)
public void setRecycleRefreshTokens(boolean recycleRefreshTokens)
public boolean isRecycleRefreshTokens()
public void init()
public void close()
public Map<String,OAuthPermission> getPermissionMap()
public void setPermissionMap(Map<String,OAuthPermission> permissionMap)
public MessageContext getMessageContext()
public void setMessageContext(MessageContext messageContext)
protected void removeClientTokens(Client c)
public Client removeClient(String clientId)
ClientRegistrationProvider
removeClient
in interface ClientRegistrationProvider
clientId
- the client idpublic Client getClient(String clientId)
OAuthDataProvider
Client
getClient
in interface ClientRegistrationProvider
getClient
in interface OAuthDataProvider
clientId
- the client idpublic void setAuthenticationStrategy(ProviderAuthenticationStrategy authenticationStrategy)
protected boolean authenticateUnregisteredClient(String clientId, String clientSecret)
protected Client createClientCredentialsClient(String clientId, String password)
protected ServerAccessToken revokeAccessToken(Client client, String accessTokenKey)
protected RefreshToken revokeRefreshToken(Client client, String refreshTokenKey)
protected abstract void saveAccessToken(ServerAccessToken serverToken)
protected abstract void saveRefreshToken(RefreshToken refreshToken)
protected abstract void doRevokeAccessToken(ServerAccessToken accessToken)
protected abstract void doRevokeRefreshToken(RefreshToken refreshToken)
protected abstract RefreshToken getRefreshToken(String refreshTokenKey)
protected abstract void doRemoveClient(Client c)
public void setInvisibleToClientScopes(List<String> invisibleToClientScopes)
public boolean isSupportPreauthorizedTokens()
public void setSupportPreauthorizedTokens(boolean supportPreauthorizedTokens)
protected static boolean isClientMatched(Client c, UserSubject resourceOwner)
protected static boolean isTokenMatched(ServerAccessToken token, Client c, UserSubject sub)
public boolean isUseJwtFormatForAccessTokens()
public void setUseJwtFormatForAccessTokens(boolean useJwtFormatForAccessTokens)
public OAuthJoseJwtProducer getJwtAccessTokenProducer()
public void setJwtAccessTokenProducer(OAuthJoseJwtProducer jwtAccessTokenProducer)
public void setJwtAccessTokenClaimMap(Map<String,String> jwtAccessTokenClaimMap)
public boolean isPersistJwtEncoding()
public void setPersistJwtEncoding(boolean persistJwtEncoding)
public String getIssuer()
public void setIssuer(String issuer)
Apache CXF