anonrig / nestjs-keycloak-admin

Keycloak client and admin provider for Nest.js applications with built-in User Managed Access (UMA) and ACL support.
https://npmjs.com/package/nestjs-keycloak-admin
MIT License
181 stars 25 forks source link

Getting 404 on startup #149

Closed tschannik closed 2 years ago

tschannik commented 2 years ago

Hi,

I just tried to replace the nest-keycloak-connect library with your one. Unfortunately with the same settings i'm getting an error on startup with very limited information.

I tried to reproduce the issue with the example backend there seems to be some issues with it.

In the following screenshots you can see all logs I'm getting: CleanShot 2022-07-19 at 14 17 58

I'm happy to provide more information if nessessary.

tschannik commented 2 years ago

I did a little more digging and found out that the problem has something to do with the "uma2-configuration" endpoint. nestjs-keycloak-admin tries to fetch the following url:

https://keycloakurl/auth/realms/master/.well-known/uma2-configuration

This endpoint returns a 404 on my keycloak server.

If i query https://keycloakurl/realms/master/.well-known/uma2-configuration

i am getting a useful result. It is also documented here Is this a missconfiguration on my server or a problem with the package?

anonrig commented 2 years ago

Thank you for this great finding! Community salutes you! It seems keycloak changed its API routes in the latest version. It's our mistake. Can you open a pull request?

curl -X GET \
  http://${host}:${port}/realms/${realm}/.well-known/uma2-configuration
anonrig commented 2 years ago

I fixed and released a version.