JHipster-Registry Swagger UI for microservice says invalid_token - jhipster

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.

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.

Related

Jhipster microservice without registry does not show swagger

I have created jhipster microservice app without any registry or gateway as I will be using aws managed gateway.
But I don't see the swagger ui.

Create jhipster monolithic UAA application

I'd like to generate with jHipster an UAA like application with the front end and backend in a monolithic application. I'd like to use the uaa Oauth2 server in order to connect with other application. Am i forced to generate a gateway + registry + uaa in order to achieve that?
Nope, in monolith all necessary oauth2 routine services will be there
UAA is not intended to works with monolith application, only in microservices environment.
If you want to have an SSO login with oauth2 I suggest you to generate your monolith with oauth2 option. Then you can choose between both Okta and keycloak.
JHipster provides docker-compose config to run a keycloak with docker (https://www.jhipster.tech/security/#oauth2).
Hope this can help you.

JHipster-Registry Swagger UI for microservice says invalid_token with UAA

I setup the following components using Jhipster (version of generator-jhipster: # 5.3.1)
Gateway
Jhipster Registry
UAA 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 only. But it gives error when the uaa or gateway 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.
UAA support for the registry was just recently added and will be in the next release. If you want to have it early, you can make the following changes:
In your UAA app's UaaConfiguration.java, add .authorities("ROLE_ADMIN") here.
Then you can use the develop tag for the jhipster-registry Docker image, and add the uaa profile to that container's SPRING_ACTIVE_PROFILES
If you prefer to run the JHipster Registry from source, you can clone the jhipster-registry repository and check out the develop branch

jhipster-registry and keycloak : cors error getting service informations

I have a problem with jhispter-registry using keycloak (or okta) for authentication. My microservices stack is mde of registry in version 4.0.1 (but I hab same problem with version 3.3.0), a gateway and a microservice generated by jhipster version 5.3.0. I use keycloak version 4.3.0 in docker.
I manage to authenticate me on registry and gateway without problems.
When I call web service required authentication through gateway (by example http://127.0.0.1:8080/ws/auth), it's ok.
But on registry with administration menu, when I want look gateway configuration (or metrics, logs, ...), I got a cors error after 2 redirections :
from registry to gateway_ip/login: ok
from gateway to keyclok: cors error
And if I want configuration of my service, I got directly an error 401.
All services (registry (version 4.0.1), gateway (generated by jhipster 5.3.0), microservices (generated by version 5.3.0) and keycloak (version 4.3.0 in docker) run in my PC. In /etc/hosts, I added ip 127.0.0.1 to keycloak. I use default configuration for all services, in dev profile.
Is it a bug of jhipster, or have I misconfigured my services ?
Thanks, Denis

How to configure JHipster microservice with cloudfoundry UAA

Is there a way to configure JHipster microservice application with the Cloudfoundry UAA?
During generation of microservice application with Yeoman JHipster generator it gives us an option to select UAA application provided by JHipster for authentication. However I don't want to use UAA application provided by JHipster.
I have other applications in cloudfoundry which use UAA instance provided by Cloudfoundry. So I want to configure the same with JHipster.
Any help is appreciated.

Resources