Highlighted

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

New Here ,
May 11, 2018

Copy link to clipboard

Copied

Hi,

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

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

Topics

Bug Error, From the Product Team, Questions Need Help

Views

212

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

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

New Here ,
May 11, 2018

Copy link to clipboard

Copied

Hi,

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

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

Topics

Bug Error, From the Product Team, Questions Need Help

Views

213

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Have something to add?

Join the conversation