keycloak / keycloak/keycloak-nodejs-connect
KeyCloak URLs should not be constructed with the auth-server-url but with the openid-configuration response
- Dominant language
- JavaScript
- Stars
- 740
- Forks
- 442
- PR merge metrics
- No merged PRs in 30d
Description
### Describe the bug
Currently the realmUrl and other URLs are constructed by prefixing them with the auth-server-url from the config file. The auth-server-url should only be uses to get the openid-configuration:
/realms//.well-known/openid-configuration
In the response of this request you can get all necessary urls (eg logout, autohorization-endpoint,...)
### Version
12
### Expected behavior
Get all openid related endpoints from /realms//.well-known/openid-configuration
### Actual behavior
https://github.com/keycloak/keycloak-nodejs-connect/blob/dd1c20f0c1e6366e98434128eafea2e78ab545fd/middleware/auth-utils/config.js#L125
https://github.com/keycloak/keycloak-nodejs-connect/blob/dd1c20f0c1e6366e98434128eafea2e78ab545fd/middleware/auth-utils/config.js#L131
https://github.com/keycloak/keycloak-nodejs-connect/blob/dd1c20f0c1e6366e98434128eafea2e78ab545fd/keycloak.js#L388
https://github.com/keycloak/keycloak-nodejs-connect/blob/dd1c20f0c1e6366e98434128eafea2e78ab545fd/keycloak.js#L403
### How to Reproduce?
_No response_
### Anything else?
_No response_
Contributor guide
Research direction
Start by reading middleware/auth-utils/config.js around lines 125 and 131, then keycloak.js around lines 388 and 403. Trace how the auth-server-url is used and how the realm's .well-known/openid-configuration response could supply the OpenID endpoints. Done means the related endpoints are obtained from that response rather than constructed from the configured server URL.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- authentication, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100