keycloak-mock
keycloak-mock copied to clipboard
'Resource not found' for standalone running
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?
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.
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.
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.
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.