Search code examples
jhipsterjhipster-registry

JHipster-Registry Swagger UI for microservice says invalid_token


I setup the following components using Jhipster (version of generator-jhipster: @ 5.0.1)

  • Gateway
  • Microservice1
  • Jhipster Registry
  • Keycloak as auth server

Everything works fine so far.

In Jhipster Registry, when I go to Administration >> API It opens up Swagger UI. Swagger UI lists the apis for Jhipster-Registry and gateway. But it gives error when the microservice is selected in the drop down. Swagger UI From Gateway (Administration >> API) works fine. Only from registry it does not work.

Please let me know if I am missing some configuration.

enter image description here


Solution

  • When using the JHipster Registry to manage an OAuth2 microservice architecture, you need to enable the oauth2 profile when running the JHipster Registry. You will then use Keycloak to log in to the registry and manage the services.