I generated new app with Jhipster generator, v4.10.0.
I'd like to use OAuth2 powered by Keycloak running in separate (it's own) application server, used by more applications. It means, not in Docker.
I set 'application.yml' according to http://www.jhipster.tech/security/ .. server, port, clientId, clientSecret => rebuild app.
mvnw -Pprod package -DskipTests
Keycloak function tested by SoapUi. It returns JSON object with tokens as usual.
KEYCLOAK use on localhost for development
Keycloak Download Keycloak server from http://www.keycloak.org/downloads.html you can follow documentation "Getting started".
My steps
- unzip in servers location C:\Servers\Keycloak\
- standalone.xml => set port-offset: 10000 because on zero there application server runs
- cmd cd C:\Servers\Keycloak\bin
- run standalone.bat
- open browser http://localhost:18080/auth
- go to admin console
- create new realm "jhipster"
- I used User federation to add LDAP users (Synchronize all users), next option is to add users manualy
- add roles (JHipster uses ADMIN and USER, SYSTEM) or Sync LDAP Roles To Keycloak
- create new client in this new realm
jhipster client setting don't forget symbol + at Web origins
- in Credentials choose Client ID and secret, generate secret and use it in application.yaml file