Hi,
I’m developing a custom Keycloak extension and want to expose custom APIs as part of Keycloak’s endpoints (e.g., /admin/realms/<realm>/custom
). Additionally, I want to document these APIs using Swagger/OpenAPI
and serve the Swagger UI
for them, similar to how Keycloak’s admin API is documented.
I followed these steps:
- Created a
JAX-RS
resource for the custom API. - Registered the resource using a
RealmResourceProvider
andRealmResourceProviderFactory
. - Added the
SmallRye OpenAPI
andSwagger UI
dependencies to the extension’spom.xml
. - Tried adding
Quarkus
OpenAPI-related properties (e.g.,quarkus.swagger-ui.always-include=true
) in a newapplication.properties
file inside the extension.
However, the APIs work but the Swagger/OpenAPI documentation does not show up. The application.properties
is not recognized, and Swagger UI is not accessible at /swagger-ui
or /openapi
.
- Ensured that the extension was correctly deployed and the custom API worked at
http://localhost:8080/admin/realms/master/custom
. - Verified dependencies for
quarkus-smallrye-openapi
andquarkus-swagger-ui
in thepom.xml
.
Despite these efforts, Swagger UI
and OpenAPI
documentation are not generated or accessible.