thunder-client-support icon indicating copy to clipboard operation
thunder-client-support copied to clipboard

Get Auth token from browser like Postman Interceptor.

Open ck196 opened this issue 3 years ago • 7 comments

  • Postman Interceptor like feature.

ck196 avatar Apr 24 '21 13:04 ck196

Hi @ck196 In OAuth tab you can generate token from browser

rangav avatar Apr 24 '21 14:04 rangav

The generate token button opens the browser, but after the callback url redirect nothing happens. Any chance for a browser url interceptor to read the auth values to then issue a token?

pascal-hauser avatar Nov 13 '22 18:11 pascal-hauser

@pascal-hauser can you share screenshots of your oauth tab

also you can view logs in output window.

rangav avatar Nov 13 '22 19:11 rangav

sure, thanks for having a look at that.

here the screenshot of the oauth tab: image the output:

OAuth2 AuthUrl Request:
https://******/protocol/openid-connect/auth?response_type=code&state=&client_id=*****&scope=profile%20offline_access&redirect_uri=http%3A%2F%2Flocaltest.me%3A8080%2Foidc-callback
Request Method: GET

the browser opens on the IDP page, after entering the credentials the redirect happens to the callback url, http://localtest.me:8080/oidc-callback in my case. But then the browser reports ERR_CONNECTION_REFUSED, as expected because nothing is listening on 8080. Here the authorization_code should be read by an interceptor and a request to the token endpoint should be made to exchange the authorization code for a token.

should this work like this? am i missing something?

thanks!

pascal-hauser avatar Nov 13 '22 19:11 pascal-hauser

This is callback url issue.

  • you need to use the default callback url - https://www.thunderclient.com/oauth/callback
  • or you can also use the localhost version - http://localhost:6789/callback

also you need add the callback your to your OAuth 2 server authorised callback list.

please use any of the above callback urls to get auth code back into extension.

rangav avatar Nov 13 '22 20:11 rangav

With the correct callback url everything works. Didn't see that anywhere in the documentation. Thank you!

pascal-hauser avatar Nov 17 '22 11:11 pascal-hauser

@pascal-hauser good, its working for you now, will update the Docs asap.

rangav avatar Nov 17 '22 11:11 rangav