1

I'm using Asp.net MVC, The problem I'm facing is that I have to send a pdf by email to get signed by the customer. Now I've done this by using DocuSign. But the Client's requirement is to send the document using Adobe Sign. Now, I need to generate an access token in the code, but the response I'm getting is "401 Unauthorized" even though my credentials are correct. (If I generate an access token from the adobe sign website and use it in my code, Works fine. But that token expires in 1 hour)

string clientId = "**********";
string clientSecret = "*************";

var tokenUrl = "https://secure.na3.adobesign.com/oauth/v2/token";

var tokenRequestBody = new Dictionary<string, string>
{
    {"client_id", clientId},
    {"client_secret", clientSecret},
    {"grant_type", "client_credentials"},
    {"scope", "user_read user_write user_login agreement_read agreement_write agreement_send library_write widget_write library_read widget_read"}
};

var tokenResponse = await client.PostAsync(tokenUrl, new FormUrlEncodedContent(tokenRequestBody));
if (tokenResponse.IsSuccessStatusCode)
{

I can't get into this block of code cuz of the response '401 Unauthorized'.

  • I think the grant type of 'Client Credentials' is not enabled from my Adobe Sign account, as Postman shows an error of invalid grant type. I can't find any option to enable 'Client Credentials' grant type. – Umer Abdul Wahid Aug 23 '23 at 20:27
  • https://secure.na3.adobesign.com/oauth/v2/token This is my Access Token URL, works for me on grant type 'Authorization Code' But says invalid grant type on 'Client Credentials' – Umer Abdul Wahid Aug 23 '23 at 21:04

0 Answers0