public abstract class OAuthHandler
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
protected |
OAuthHandler(java.lang.String tokenApiUrl,
java.lang.String clientId,
java.lang.String clientSecret) |
Modifier and Type | Method and Description |
---|---|
protected abstract java.lang.String |
buildTokenRequestPayload(MessageContext messageContext)
Return the request payload relevant to the OAuth handler.
|
java.lang.String |
getClientId()
Return the client id relevant to the OAuth Handler.
|
java.lang.String |
getClientSecret()
Return the client secret relevant to the OAuth Handler.
|
protected java.lang.String |
getEncodedCredentials(MessageContext messageContext)
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.
|
org.apache.axiom.om.OMElement |
serializeOAuthConfiguration(org.apache.axiom.om.OMFactory omFactory)
This method returns an OMElement containing the OAuth configuration.
|
protected abstract org.apache.axiom.om.OMElement |
serializeSpecificOAuthConfigs(org.apache.axiom.om.OMFactory omFactory)
Return the OMElement for OAuth configuration relevant to the OAuth handler.
|
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.
|
protected OAuthHandler(java.lang.String tokenApiUrl, java.lang.String clientId, java.lang.String clientSecret)
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()
public java.lang.String getClientId()
public java.lang.String getClientSecret()
protected abstract java.lang.String buildTokenRequestPayload(MessageContext messageContext) throws OAuthException
OAuthException
protected abstract org.apache.axiom.om.OMElement serializeSpecificOAuthConfigs(org.apache.axiom.om.OMFactory omFactory)
public org.apache.axiom.om.OMElement serializeOAuthConfiguration(org.apache.axiom.om.OMFactory omFactory)
protected java.lang.String getEncodedCredentials(MessageContext messageContext) throws OAuthException
messageContext
- Message Context of the request which will be used to resolve dynamic expressionsOAuthException
- In the event of errors when resolving the dynamic expressionsprotected 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.