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
Incorrect function is used in 'keycloak-admin-client' library in getToken function #19879
Comments
Hi, I got the same issue while upgrading to admin@21.1.1 it's seems there is an error in auth.ts keycloak/js/libs/keycloak-admin-client/src/utils/auth.ts Lines 80 to 83 in f7988a6
The correct header should be something like this : headers.set("Authorization","Basic "+btoa(credentials.clientId + ":" + credentials.clientSecret)); Thank you |
Correct getToken error This fix a regression on migration from Axios To FetchAPI Credential header must be encoded not decoded. This fix keycloak#19879
BTW, authorization does not work properly even the function is changed to btoa. clientId and clientSecret should be sent in request body. |
Hi @hmica, would you be willing to submit a pull request to fix this? We'll try to backport it to a patch release. |
I see you already did, will take a look at it 👍 |
Same issue here.
|
Correct getToken error This fix a regression on migration from Axios To FetchAPI Credential header must be encoded not decoded. This fix keycloak#19879
Before reporting an issue
Area
adapter/javascript
Describe the bug
It looks like it's just a simple mistake - 'atob' function is used instead of 'btoa'
Version
2022.9
Expected behavior
'btoa' function should be used
Actual behavior
'atob' function is used
How to Reproduce?
just run getToken function
Anything else?
No response
The text was updated successfully, but these errors were encountered: