public abstract class OAuthHandler
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
protected |
OAuthHandler(java.lang.String tokenApiUrl) |
Modifier and Type | Method and Description |
---|---|
protected abstract java.lang.String |
buildTokenRequestPayload(MessageContext messageContext)
Return the request payload relevant to the OAuth handler.
|
protected abstract java.lang.String |
getEncodedCredentials()
Return the base 64 encoded clientId:clientSecret relevant to the OAuth handler.
|
protected java.lang.String |
getRequestParametersAsString(MessageContext messageContext)
Return the request parameters as a string
|
java.util.Map<java.lang.String,java.lang.String> |
getRequestParametersMap() |
java.lang.String |
getTokenUrl()
Return the token server url relevant to the OAuth handler.
|
void |
removeTokenFromCache()
Method to remove the token from the cache when the endpoint is destroyed
|
void |
setOAuthHeader(MessageContext messageContext)
This method will set the Authorization header after checking for expired tokens and generating new access
tokens
|
void |
setRequestParameters(java.util.Map<java.lang.String,java.lang.String> requestParameters)
Method to set the request parameter map
|
public void setOAuthHeader(MessageContext messageContext) throws OAuthException
messageContext
- Message context to which the token needs to be setOAuthException
- In the event of errors when generating new tokenpublic void removeTokenFromCache()
public java.lang.String getTokenUrl()
protected abstract java.lang.String buildTokenRequestPayload(MessageContext messageContext) throws OAuthException
OAuthException
protected abstract java.lang.String getEncodedCredentials()
protected java.lang.String getRequestParametersAsString(MessageContext messageContext) throws OAuthException
OAuthException
public void setRequestParameters(java.util.Map<java.lang.String,java.lang.String> requestParameters)
requestParameters
- the request parameter mappublic java.util.Map<java.lang.String,java.lang.String> getRequestParametersMap()
Copyright © 2005-2021 Apache Software Foundation. All Rights Reserved.