thunderclient / thunder-client-support

Thunder Client is a lightweight Rest API Client Extension for VS Code.
https://www.thunderclient.com
Other
3.64k stars 131 forks source link

0Auth 2 session cookie extraction and redirect issues #776

Closed PatrickMunsey closed 2 years ago

PatrickMunsey commented 2 years ago

Description

I'm trying to sign into my api using thunder client however I'm unable to do so through the extension and need to manually copy session cookie details from browser devtools into the request header. I am able to login to my application normally through the browser. Is there an existing method to authenticate Thunder Client this may?

When using Got in Thunder client settings withGot

When using Axios in Thunder client settings withAxios

What does work

I'm able to login to my applicaiton and manually setup the auth in Thunder client but I'm wondering if there's a quicker way to generate the auth settings in thunder client like the "Generate Token" from and redirect without having to keep on opening and copying details from browser devtools.

Platform:

rangav commented 2 years ago

@PatrickMunsey thanks for reporting the issue.

can you share your oauth tab screenshot with masking any sensitive data

PatrickMunsey commented 2 years ago

ThunderClient-AuthInfo

rangav commented 2 years ago

You need to enter token url field value

rangav commented 2 years ago

Is your issue resolved?

PatrickMunsey commented 2 years ago

Hi @rangav,

I still haven't been able to figure this out. To clarify, I'm using cookie sessions and passportjs google strategy to authenticate, not JWTs, so i'm not sure how token url applies to this or what the value should be in my case.

I'm still able to manually copy the session id from my browser into the Cookie field in the header so the issue isn't urgent but it would be nice to at some point to figure out a way to login to my api through the extension.

rangav commented 2 years ago

See below links https://stackoverflow.com/a/53529534

https://infinitecoder.github.io/posts/2017-12-22-how-to-authorize-using-oauth-2-0-in-postman/

PatrickMunsey commented 2 years ago

It works!!!

Thank you so much for helping me through that.

My confusion came from the 'token_url' not being displayed in the google cloud console dashboard under the 0Auth client credentials tab.

I had to download the full json for the client ID in order to see the field. It turned out being https://oauth2.googleapis.com/token in my case which appears to be a general url for anyone attempting this in the future for google auth.

typytypytypy commented 1 year ago

This issue was really helpful for me in debugging my setup. I wanted to add that I am using an SSH connection in VSCode and to get the token generation to work I had to run a separate instance locally.