keycloak/keycloak-nodejs-admin-client

Login fails with 404

Kinrany opened this issue · 1 comments

Describe the bug
Trying to authenticate with login and password. It fails because the constructed URL has a double slash //, because baseUrl ends with a slash.

The error:

RESTEASY003210: Could not find resource for full path: https://<redacted>/auth//realms/test-str/protocol/openid-connect/token
                                                                               ^ here

To Reproduce
Steps to reproduce the behavior:

  1. Write a script that logs into a Keycloak instance
  2. Append a / to the provided baseUrl
  3. Run the script again, observe a 404 error

Expected behavior
The client accepts any valid URL as baseUrl

Enviroment (please complete the following information):

  • OS: MacOS Catalina
  • Keycloak Version: uhh, the latest one?
  • Library Version: 1.13.0

This is still a problem with the latest client when providing the connectionConfig object manually to the constructor. Using Keycloak's provided auth server URL (http://localhost:8080/auth/ in my case) throws a 404 error on .auth method. Removing the trailing slash does the trick.