Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oAuth2 Authorization token flow improvements #1565

Closed
m-schrepel opened this issue Jul 1, 2024 · 5 comments
Closed

oAuth2 Authorization token flow improvements #1565

m-schrepel opened this issue Jul 1, 2024 · 5 comments
Labels
feature request New feature or request Priority Implement this asap

Comments

@m-schrepel
Copy link

m-schrepel commented Jul 1, 2024

Please describe feature/problem details and the solution you'd like.
We use a custom authorization header instead of Authorization, which means when we use the oAuth2 flow, we have to manually copy and paste the token to an environment variable.

A possible solution would be: Allow for defining a header other than Authorization in the advanced part of the oauth2 flow.

Another solution would be to make the post-request scripts work with the authorization requests. This way we could set a dynamic variable in memory.

Describe alternatives you've considered
I tried something like this

tc.request.setHeader('Custom-Header', tc.request.getHeader('Authorization'))

which also doesn't work and would be another viable solution to our issue

Are you using the free version/paid version/trial:
Enterprise customer

@m-schrepel m-schrepel added the feature request New feature or request label Jul 1, 2024
@rangav
Copy link
Collaborator

rangav commented Jul 1, 2024

Thanks @m-schrepel for the feedback. I will review and add to the roadmap.

@rangav rangav added the Priority Implement this asap label Sep 20, 2024
@rangav
Copy link
Collaborator

rangav commented Sep 21, 2024

This feature has been implemented and published to the marketplace. Please update to v2.25.7.

You can see all the features released in this update
https://github.com/rangav/thunder-client-support/releases/tag/v2.25.7

Please test it and let me know your feedback

@rangav rangav closed this as completed Sep 21, 2024
@aagranovExtend
Copy link

aagranovExtend commented Sep 24, 2024

@rangav for the oauth2 improvements, can I access the OAuth2 tab via scripting?

This doesn't work:
const accessToken = tc.request.auth.oauth2.get('accessToken')

Error in Pre Request Script: - Cannot read properties of undefined (reading 'oauth2')

@rangav
Copy link
Collaborator

rangav commented Sep 25, 2024

@aagranovExtend Currently not possible, I will add it in the next update.

@rangav
Copy link
Collaborator

rangav commented Sep 25, 2024

We published new update to add further improvements in v2.25.8

New Additions:

  • Access authorization header in Post Req Script - tc.request.getHeader('Authorization')
  • Added auth property to request model in script. To get access token use this - tc.request.auth.oauth2.accessToken. Log auth property using console.log(tc.request.auth) to see all props available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request Priority Implement this asap
Projects
None yet
Development

No branches or pull requests

3 participants