public abstract class AbstractOAuthDataProvider extends Object implements OAuthDataProvider
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractOAuthDataProvider() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
List<OAuthPermission> |
convertScopeToPermissions(Client client,
List<String> requestedScopes)
Converts the requested scope to the list of permissions
|
ServerAccessToken |
createAccessToken(AccessTokenRegistration reg)
Create access token
|
protected ServerAccessToken |
createNewAccessToken(Client client) |
protected RefreshToken |
createNewRefreshToken(ServerAccessToken at) |
protected ServerAccessToken |
doCreateAccessToken(AccessTokenRegistration accessToken) |
protected RefreshToken |
doCreateNewRefreshToken(ServerAccessToken at) |
protected ServerAccessToken |
doRefreshAccessToken(Client client,
RefreshToken oldRefreshToken,
List<String> restrictedScopes) |
protected abstract List<ServerAccessToken> |
getAccessTokens(Client c) |
org.apache.cxf.jaxrs.ext.MessageContext |
getMessageContext() |
Map<String,OAuthPermission> |
getPermissionMap() |
ServerAccessToken |
getPreauthorizedToken(Client client,
List<String> requestedScopes,
UserSubject subject,
String grantType)
Get preauthorized access token
|
protected abstract RefreshToken |
getRefreshToken(String refreshTokenKey) |
protected abstract List<RefreshToken> |
getRefreshTokens(Client c) |
protected void |
handleLinkedRefreshToken(ServerAccessToken accessToken) |
void |
init() |
protected boolean |
isRefreshTokenSupported(List<String> theScopes) |
ServerAccessToken |
refreshAccessToken(Client client,
String refreshTokenKey,
List<String> restrictedScopes)
Refresh access token
|
void |
removeAccessToken(ServerAccessToken token)
Removes the access token
The runtime will call this method if it finds that a token has expired
|
protected void |
removeClientTokens(Client c) |
protected abstract ServerAccessToken |
revokeAccessToken(String accessTokenKey) |
protected void |
revokeAccessTokens(RefreshToken currentRefreshToken) |
protected abstract RefreshToken |
revokeRefreshToken(String refreshTokenKey) |
void |
revokeToken(Client client,
String tokenKey,
String tokenTypeHint)
Revokes a refresh or access token
|
protected abstract void |
saveAccessToken(ServerAccessToken serverToken) |
protected abstract void |
saveRefreshToken(ServerAccessToken at,
RefreshToken refreshToken) |
void |
setAccessTokenLifetime(long accessTokenLifetime) |
void |
setMessageContext(org.apache.cxf.jaxrs.ext.MessageContext messageContext) |
void |
setPermissionMap(Map<String,OAuthPermission> permissionMap) |
void |
setRecycleRefreshTokens(boolean recycleRefreshTokens) |
void |
setRefreshTokenLifetime(long refreshTokenLifetime) |
void |
setScopes(Map<String,String> scopes) |
protected void |
unlinkRefreshAccessToken(RefreshToken rt,
String tokenKey) |
protected RefreshToken |
updateRefreshToken(RefreshToken rt,
ServerAccessToken at) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAccessToken, getClientpublic ServerAccessToken createAccessToken(AccessTokenRegistration reg) throws OAuthServiceException
OAuthDataProvidercreateAccessToken in interface OAuthDataProviderreg - the token registration infoOAuthServiceExceptionprotected ServerAccessToken doCreateAccessToken(AccessTokenRegistration accessToken)
public void removeAccessToken(ServerAccessToken token) throws OAuthServiceException
OAuthDataProviderremoveAccessToken in interface OAuthDataProvidertoken - the tokenOAuthServiceExceptionpublic ServerAccessToken refreshAccessToken(Client client, String refreshTokenKey, List<String> restrictedScopes) throws OAuthServiceException
OAuthDataProviderrefreshAccessToken in interface OAuthDataProviderclient - the clientrefreshTokenKey - refresh token keyrestrictedScopes - the scopes requested by the clientOAuthServiceExceptionpublic void revokeToken(Client client, String tokenKey, String tokenTypeHint) throws OAuthServiceException
OAuthDataProviderrevokeToken in interface OAuthDataProvidertokenKey - token identifierOAuthServiceExceptionprotected void handleLinkedRefreshToken(ServerAccessToken accessToken)
protected void revokeAccessTokens(RefreshToken currentRefreshToken)
protected void unlinkRefreshAccessToken(RefreshToken rt, String tokenKey)
public List<OAuthPermission> convertScopeToPermissions(Client client, List<String> requestedScopes)
OAuthDataProviderconvertScopeToPermissions in interface OAuthDataProviderpublic ServerAccessToken getPreauthorizedToken(Client client, List<String> requestedScopes, UserSubject subject, String grantType) throws OAuthServiceException
OAuthDataProvidergetPreauthorizedToken in interface OAuthDataProviderclient - ClientrequestedScopes - the scopes requested by the clientsubject - End User subjectOAuthServiceExceptionprotected ServerAccessToken createNewAccessToken(Client client)
protected RefreshToken updateRefreshToken(RefreshToken rt, ServerAccessToken at)
protected RefreshToken createNewRefreshToken(ServerAccessToken at)
protected RefreshToken doCreateNewRefreshToken(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 void init()
public void close()
public Map<String,OAuthPermission> getPermissionMap()
public void setPermissionMap(Map<String,OAuthPermission> permissionMap)
public org.apache.cxf.jaxrs.ext.MessageContext getMessageContext()
public void setMessageContext(org.apache.cxf.jaxrs.ext.MessageContext messageContext)
protected void removeClientTokens(Client c)
protected abstract void saveAccessToken(ServerAccessToken serverToken)
protected abstract void saveRefreshToken(ServerAccessToken at, RefreshToken refreshToken)
protected abstract ServerAccessToken revokeAccessToken(String accessTokenKey)
protected abstract List<ServerAccessToken> getAccessTokens(Client c)
protected abstract List<RefreshToken> getRefreshTokens(Client c)
protected abstract RefreshToken revokeRefreshToken(String refreshTokenKey)
protected abstract RefreshToken getRefreshToken(String refreshTokenKey)
Apache CXF