0

I have the below set up that I use to fetch oauth token in postman. How do I write this as an ajax call in jQuery

Postman Details :

tokenUrl => someUrl
grant_type => client_credentials
client_id => xxxxx
client_secret => yyyyy
client authentication => **Send as Basic Auth Header**

Thanks in Advance

RJD
  • 135
  • 3
  • 14
  • is this link useful? https://stackoverflow.com/questions/14010851/set-request-header-jquery-ajax – Casper Dijkstra Oct 27 '20 at 14:48
  • I tried the examples mentioned. It is a cross domain request. The error I receive is Access to XMLHttpRequest at '..../oauth/token' from origin 'http://localhost:8000' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header contains multiple values '*, http://localhost:8000', but only one is allowed. The response headers has 2 values for Access-Control-Allow-Origin = . * and localhost. httpd.conf has only one entry for Access-Control-Allow-Origin so not sure from where the second one is being added – RJD Oct 27 '20 at 22:37

0 Answers0