Package com.mastercard.developer.oauth
Class OAuth
- java.lang.Object
-
- com.mastercard.developer.oauth.OAuth
-
public class OAuth extends Object
Performs OAuth1.0a compliant signing with body hash support for non-urlencoded content types.
-
-
Field Summary
Fields Modifier and Type Field Description static StringAUTHORIZATION_HEADER_NAMEstatic StringEMPTY_STRING
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgetAuthorizationHeader(URI uri, String method, String payload, Charset charset, String consumerKey, PrivateKey signingKey)Creates a Mastercard API compliant OAuth Authorization header
-
-
-
Field Detail
-
EMPTY_STRING
public static final String EMPTY_STRING
- See Also:
- Constant Field Values
-
AUTHORIZATION_HEADER_NAME
public static final String AUTHORIZATION_HEADER_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getAuthorizationHeader
public static String getAuthorizationHeader(URI uri, String method, String payload, Charset charset, String consumerKey, PrivateKey signingKey)
Creates a Mastercard API compliant OAuth Authorization header- Parameters:
uri- Target URI for this requestmethod- HTTP method of the requestpayload- Payload (nullable)charset- Charset encoding of the requestconsumerKey- Consumer key set up in a Mastercard Developer Portal projectsigningKey- The private key that will be used for signing the request that corresponds to the consumerKey- Returns:
- Valid OAuth1.0a signature with a body hash when payload is present
-
-