0
votes

I am trying to authenticate to an oauth2 provider with an implicit flow.

I am able to connect with postman and I am able to get a valid token. Can I see what postman do somewhere ?

enter image description here

However I cannot seem to find a library in javacript that can connect to an implicit flow.

I tried JSO and I keep getting an invalid_request error

let client = new jso.JSO(
{
  client_id: "redacted_",
  redirect_uri: "http://localhost:63342/untitled/index.html",
  authorization: "https://redacted_/connect/authorize",
  scopes: {
  request: ['apiclients']
},});

I also tried salte-auth but it seems that it only support a subset of providers.

How can I connect to the oauth2 provider like Postman did or how can I implement this in javascript ?

2

2 Answers

0
votes

Postman just posts HTTP requests. You can see the HTTP requests in the Postman Console. Postman Console

The Third button on the bottom left. With this you can see the difference between the requests you are making in JavaScript and Postman.

0
votes

Finally I used Fiddler to compare Postman request to my request and I had to specify the response_type:

response_type: 'token',