Hi,
the „keycloak-authz-client“ package provides the AuthzClient class, which can be created
by calling „AuthzClient.create()“.
This automatically detects a „keycloak.json“ file and reads values for the „Configuration“
object.
This is all good.
But when it comes to Spring Boot apps using the Spring Boot Adapter, there is no
„keycloak.json“ file and instead the values are provided via the „application.properties“
(or .yml, or else).
I would appreciate, that „AuthzClient.create()“ would also be possible to detect the
Spring Boot Property configuration and use it from there.
Was this already discussed? Is it planned? Should I create a ticket for it?
If you already have any ideas, share them with me, I could do a PR for it.
Currently, I’m using a workaround like this:
https://gist.github.com/dasniko/2c64393da0bca89434670908141914c4
<
https://gist.github.com/dasniko/2c64393da0bca89434670908141914c4>
So I can inject the AuthzClient everywhere I like and the KeycloakSpringBootProperties
object is injected in the Bean definition.
It’s not a nice way, although it works.
The classes „Configuration“ and „KeycloakSpringBootProperties“ both extend
„AdapterConfig“. Perhaps AuthzClient could also use AdapterConfig, instead of only
Configuration!?
Regards,
- Niko