-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix: OAuth 2.0 Grant Type Authorization: "invalid_client" error / URL Encode of Client ID #2129
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. Using the URL
class is a nice improvement compared to string concatenation.
let oauth2QueryParams = | ||
(authorizationUrl.indexOf('?') > -1 ? '&' : '?') + `client_id=${clientId}&response_type=code`; | ||
const authorizationUrlWithQueryParams = new URL(authorizationUrl); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using the URL class to construct the request URL looks a lot cleaner than the previous string concatenation with some nested ternary operator in the middle. 👍
Any progress here? |
+1 Would like to see this merged in, getting the same error. |
30e80b4
to
bacbd04
Compare
@sanjai0py bumping this for you attention - please let's have this bug fixed. |
@lohxt1 please merge this once you have done your testing. |
Thank you, @pietrygamat, for taking the time to contribute to this PR. The next release will include your valuable fix! Also, a big thank you to @andreassiegel for taking the time to review it! |
Description
Fixes issue where OAuth2 parametrs handled by bruno were not url encoded in final request.
fixes #2115
#1003
Contribution Checklist: