API Authentication Issue | Community
Skip to main content
Level 2
November 14, 2023
Solved

API Authentication Issue

  • November 14, 2023
  • 1 reply
  • 1003 views

Hi All, 

i am writing a javascript code to get the access token from an API using grant_type = authorization_code but i am getting the below error : 

 

HTTP header 'WWW-Authenticate' used for proxy authentication not found.

 

var req = new HttpClientRequest("https://verticurlpartnersandbox.my.workfront.com/integrations/oauth2/api/v1/token");
var buffer = new MemoryBuffer()
buffer.fromString("359dff62b1b476c10a056edc20a8807a" + ':' + "Yh-7Vd031Ag0j-GqORsKJqfN6YhhN0c6RdkWRZSZUps", "utf-8");
req.header["Authorization"] = "Basic" + buffer.toBase64();
req.header["Content-Type"] = "application/x-www-form-urlencoded";
req.method = "POST";
var resBody = 'grant_type=authorization_code&redirect_uri=https://vrapidodev.verticurl.com/authTest/authCodeTest.php&code=655386c2c9fe50001dbc911c&client_id=359dff62b1b476c10a056edc20a8807a&client_secret=Yh-7Vd031Ag0j-GqORsKJqfN6YhhN0c6RdkWRZSZUps';

req.body = resBody;
req.execute();

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Manoj_Kumar

Hello @ignatius_dilip 

 

I believe you are missing the code key value pair in the body

The example given in the documentation here shows code is mandatory: Authorization code flow for custom OAuth 2 applications | Adobe Workfront

1 reply

Manoj_Kumar
Community Advisor
Manoj_KumarCommunity AdvisorAccepted solution
Community Advisor
November 15, 2023

Hello @ignatius_dilip 

 

I believe you are missing the code key value pair in the body

The example given in the documentation here shows code is mandatory: Authorization code flow for custom OAuth 2 applications | Adobe Workfront

Manoj  | https://themartech.pro
Level 2
November 22, 2023

Hi Manoj,

 

Thanks for the feedback. 

 

It is working fine now