Class OAuth


  • public class OAuth
    extends Object
    Performs OAuth1.0a compliant signing with body hash support for non-urlencoded content types.
    • 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 request
        method - HTTP method of the request
        payload - Payload (nullable)
        charset - Charset encoding of the request
        consumerKey - Consumer key set up in a Mastercard Developer Portal project
        signingKey - 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