Skip to main content
Participant
May 12, 2018
Question

Getting access token using code, client id and client secret gives the error

  • May 12, 2018
  • 0 replies
  • 392 views

Hi,

I have been getting access_token using this method, but today its not working. It returns an error

although it has been working properly before today.

I am using this code:

var context = new AdobeSignSdk.Context();

        var oAuthApi = new AdobeSignSdk.OAuthApi(context);

        var oAuthModel = AdobeSignSdk.OAuthModel;

        //Fetch the access token.       

        var accessTokenRequest = new oAuthModel.AccessTokenRequest();

        accessTokenRequest.setClientId("########");

        accessTokenRequest.setClientSecret("########");

        accessTokenRequest.setRedirectUri("https://example.com");

        accessTokenRequest.setCode("######");

        accessTokenRequest.setGrantType("authorization_code");

        oAuthApi.getAccessToken(accessTokenRequest)

            .then(function (accessTokenResponse) {

                console.log(accessTokenResponse.getAccessToken())

            })

            .catch(function (apiError) {

                console.log(apiError);

            });

help will be highly appreciated. Please reply me as soon as possible.

Regards,

Muhammad Mohsan

This topic has been closed for replies.