keycloak / keycloak/keycloak-nodejs-connect
keycloak.logoutUrl do not include the redirectUrl unless the idTokenHint is also passed
- Dominant language
- JavaScript
- Stars
- 740
- Forks
- 442
- PR merge metrics
- No merged PRs in 30d
Description
### Describe the bug
When using the Keycloak-connect npm package, there is a function to generate the logout url: keycloak.logoutUrl.
According to the typescript types, it accepts 2 parameters:
- redirectUrl: string (mandatory)
- idTokenHint?: string (not-mandatory)
Calling this method with only the mandatory parameter does not gives the expected output.
### Version
20.0.2
### Expected behavior
When only the mandatory parameter redirectUrl is passed to the function, the generated logout url should contain it.
### Actual behavior
The redirectUrl parameter does not get added to the generated logout url unless the optional idTokenHint is passed as well. In this case, both are added to the generated url.
### How to Reproduce?
Get a configured setup of keycloak-connect and call the method keycloak.logoutUrl with only 1 parameter. In that case, the parameter value does not get found in the generated logout url
### Anything else?
I'll create a PR to fix this
Contributor guide
Research direction
Start at the keycloak.logoutUrl method in the Keycloak-connect npm package and reproduce the issue with a configured setup, passing only redirectUrl. Done means the generated logout URL contains redirectUrl without requiring idTokenHint; verify the existing behavior with both parameters as well.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- authentication, backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100