Interface RemoteAPITokenService
-
- All Known Implementing Classes:
RemoteAPITokenServiceImpl
public interface RemoteAPITokenServiceService for saving and reading tokens for Remote APIs
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description RemoteAPITokencreate(RemoteAPIToken token)Add a token to the store for a given serviceRemoteAPITokencreateTokenFromAuthCode(java.lang.String authcode, RemoteAPI remoteAPI, java.lang.String tokenRedirect)Create a newRemoteAPITokenfrom a given auth codevoiddelete(RemoteAPI remoteAPI)Delete a token for the logged in user and a givenRemoteAPIRemoteAPITokengetToken(RemoteAPI remoteAPI)Get a token for a given serviceRemoteAPITokenupdateTokenFromRefreshToken(RemoteAPI api)Update a givenRemoteAPI's OAuth token by refresh token if available
-
-
-
Method Detail
-
create
RemoteAPIToken create(RemoteAPIToken token)
Add a token to the store for a given service- Parameters:
token- The token to create- Returns:
- the created token
-
getToken
RemoteAPIToken getToken(RemoteAPI remoteAPI) throws EntityNotFoundException
Get a token for a given service- Parameters:
remoteAPI- TheRemoteAPIof the service root- Returns:
- A String OAuth2 token
- Throws:
EntityNotFoundException- if the token could not be found
-
delete
void delete(RemoteAPI remoteAPI) throws EntityNotFoundException
Delete a token for the logged in user and a givenRemoteAPI- Parameters:
remoteAPI- theRemoteAPIto delete a token for- Throws:
EntityNotFoundException- if the token could not be found
-
createTokenFromAuthCode
RemoteAPIToken createTokenFromAuthCode(java.lang.String authcode, RemoteAPI remoteAPI, java.lang.String tokenRedirect) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException
Create a newRemoteAPITokenfrom a given auth code- Parameters:
authcode- the auth code to create a token forremoteAPI- the remote api to get a token fortokenRedirect- a redirect url to get the token from- Returns:
- the newly created token
- Throws:
org.apache.oltu.oauth2.common.exception.OAuthSystemException- If ther's a problem building the token requestorg.apache.oltu.oauth2.common.exception.OAuthProblemException- If there's a problem with the token request
-
updateTokenFromRefreshToken
RemoteAPIToken updateTokenFromRefreshToken(RemoteAPI api)
Update a givenRemoteAPI's OAuth token by refresh token if available- Parameters:
api- the API to update- Returns:
- the most recent token if available
-
-