I would like to use my Keycloak authentication for Swagger UI generated by Quarkus. This is my config in application.properties:
quarkus.swagger-ui.oauth2-redirect-url=http://localhost:8080/q/swagger-ui/oauth2-redirect.html
quarkus.smallrye-openapi.security-scheme=oidc
quarkus.smallrye-openapi.security-scheme-name=Keycloak
quarkus.smallrye-openapi.oidc-open-id-connect-url=http://localhost:8888/auth/realms/myrealm/.well-known/openid-configuration
quarkus.swagger-ui.oauth2-redirect-url=http://localhost:8080/q/swagger-ui
And my REST Controllers are annotated like this:
@Path("/my-path")
@Authenticated
@SecurityRequirement(name = "Keycloak")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public class MyController {
@GET
public List<MyObject> listAll() {
// [...]
}
}
Now when I click on the "Authorize" button in Swagger, instead of being redirected to my Keycloak login page, I get a popup with all the different Available authorizations:
I cannot use any of these since my Keycloak is not allowing direct grants.
How can I achieve a login with redirect? Is this even possible?
Bonus question: Why do the swagger properties show up as unused in IntelliJ?


