keycloak-nodejs-admin-client
keycloak-nodejs-admin-client copied to clipboard
Wrong api call in auth .
Describe the bug
There is a wrong API call in auth function which is basically {{localhost}}/auth/{{realmName}}/myrealm/protocol/openid-connect/token but it should be {{localhost}}/realms/{{realmName}}/protocol/openid-connect/token .
Version
18.0.1
Expected behavior
The API call from axios during auth request should be {{localhost}}/realms/{{realmName}}/protocol/openid-connect/token
Actual behavior
The API call from axios during auth request is {{localhost}}/auth/realms/{{realmName}}/protocol/openid-connect/token
How to Reproduce?
Install dockerize keycloack version 18.0.1 and try to create a node client with keycloack-nodejs-admin-client 18.0.2. and paste the code below.
import KcAdminClient from '@keycloak/keycloak-admin-client'; const kcAdminClient = new KcAdminClient.default();
try{ await kcAdminClient.auth({ username:'myuser', password:'123456789', grantType:"password", clientId:"test-client", }); }catch(er){ console.log(er); }
then run with node index.js to check the result
Anything else?
No response
I also think that this is a bug. For now you can workaround this by overwriting the baseUrl:
const kcAdminClient = new KcAdminClient.default({
baseUrl: 'http://localhost:8080/'
});
Any updates on this? It looks like the /well-known/uma2-configuration endpoint is also called with /auth but should be called without it.