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();