keycloak-mock icon indicating copy to clipboard operation
keycloak-mock copied to clipboard

'Resource not found' for standalone running

Open mleegwt opened this issue 3 years ago • 4 comments

When starting the standalone version I expected to be able to access the realms and other URIs.

Startup shows the following logging (including accessing a realm):

$ java -jar standalone-0.10.0.jar
[main] INFO com.tngtech.keycloakmock.standalone.Main - Server is running on http://localhost:8000
[vert.x-eventloop-thread-0] INFO com.tngtech.keycloakmock.impl.handler.CommonHandler - 404: GET /auth/realms/master

Is my expectation correct to be able to access these URLs? Or is this a bug?

mleegwt avatar Sep 29 '21 14:09 mleegwt

At the moment, only the bare minimum endpoints are implemented to make OpenID Connect work. Stuff like /auth/realms/master is just not implemented, so you'll get a 404.

ostrya avatar Sep 30 '21 07:09 ostrya

Do you need this endpoint? It does not seem to be part of the OpenID spec but a Keycloak-specific endpoint. Also, I did not find any documentation of this feature in the Keycloak documentation.

ostrya avatar Oct 01 '21 09:10 ostrya

The validation that already exists in my application uses the information to check validity of the KeyCloak instance. So I would prefer to include this. The Keycloak documentation is https://www.keycloak.org/docs-api/5.0/rest-api/index.html#_realmrepresentation and https://www.keycloak.org/docs-api/5.0/rest-api/index.html#_realms_admin_resource I think. Many fields are optional. Currently in use: Public key and realm. Both to allow checking validity of the token.

mleegwt avatar Oct 01 '21 10:10 mleegwt

I think the standard way would be to use the /auth/realms/master/.well-known/openid-configuration to discover the URL to the public key, and the realm name is already part of the URL. But we can put this on the queue with low prio.

ostrya avatar Oct 04 '21 06:10 ostrya