Closed ThomasWilhelmUR closed 6 years ago
Yes, this is expected. You have to create a hosts entry for keycloak that points to 127.0.0.1 and everything will work. We tried to come up with a better solution, but failed to do so.
On Nov 23, 2017, at 10:34, TW notifications@github.com wrote:
Overview of the issue
In a microservice environment running in docker using the new Keycloak feature, the sign in links will take you here: http://keycloak:9080/auth/realms/jhipster/protocol/openid-connect/auth?client_id=web_app&redirect_uri=http://localhost:8080/login&response_type=code&scope=openid%20profile%20email&state=2HNh2B
Motivation for or Use Case
Testing the new Keycloak integration.
Reproduce the error
How I did it / how to reproduce:
Create new microservice using keycloak Create new gateway using keycloak Create a dummy entity (like "foo") and regenerate. Run the docker-compose subgenerator Start all of the apps using "docker-compose up -d" Related issues
When changing "keycloak:9080/" to "localhost:9080/" there is another error. to be posted.
Suggest a Fix
Clicking "sign in" in the gateway should take you to "localhost:9080".
JHipster Version(s)
4.10.2
JHipster configuration
Service:
{ "generator-jhipster": { "promptValues": { "packageName": "en.something", "nativeLanguage": "de" }, "jhipsterVersion": "4.10.2", "baseName": "service", "packageName": "en.something", "packageFolder": "en/something", "serverPort": "8081", "authenticationType": "oauth2", "hibernateCache": "hazelcast", "clusteredHttpSession": false, "websocket": false, "databaseType": "sql", "devDatabaseType": "postgresql", "prodDatabaseType": "postgresql", "searchEngine": "elasticsearch", "messageBroker": false, "serviceDiscoveryType": "eureka", "buildTool": "maven", "enableSocialSignIn": false, "enableSwaggerCodegen": false, "jwtSecretKey": "1372d952e81cee4ed366b7d48c803dd3904c35cd", "enableTranslation": true, "applicationType": "microservice", "testFrameworks": [], "jhiPrefix": "jhi", "nativeLanguage": "de", "languages": [ "de" ], "clientPackageManager": "yarn", "skipClient": true, "skipUserManagement": true } } Gateway:
{ "generator-jhipster": { "promptValues": { "packageName": "en.something", "nativeLanguage": "de", "microservicePath": "../service" }, "jhipsterVersion": "4.10.2", "baseName": "gateway", "packageName": "en.something", "packageFolder": "en/something", "serverPort": "8080", "authenticationType": "oauth2", "hibernateCache": "hazelcast", "clusteredHttpSession": false, "websocket": false, "databaseType": "sql", "devDatabaseType": "postgresql", "prodDatabaseType": "postgresql", "searchEngine": "elasticsearch", "messageBroker": false, "serviceDiscoveryType": "eureka", "buildTool": "maven", "enableSocialSignIn": false, "enableSwaggerCodegen": false, "clientFramework": "angularX", "useSass": true, "clientPackageManager": "yarn", "applicationType": "gateway", "testFrameworks": [], "jhiPrefix": "jhi", "enableTranslation": true, "nativeLanguage": "de", "languages": [ "de", "en" ] } } Entity configuration(s) entityName.json files generated in the .jhipster directory
Foo.json { "fluentMethods": true, "relationships": [], "fields": [ { "fieldName": "fooname", "fieldType": "String" } ], "changelogDate": "20171123142052", "dto": "no", "service": "no", "entityTableName": "foo", "jpaMetamodelFiltering": false, "pagination": "no", "microserviceName": "service", "searchEngine": "elasticsearch" } Browsers and Operating System
Windows, Chrome/FF
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
Thank you. Can you point me to the disccusion? (I looked around in lots of issues but didn't see it before, thanks!)
Could the referenced issue #6723 come down to this too?
Edit: In application.yaml the localhost is hardcoded:
security:
basic:
enabled: false
oauth2:
client:
access-token-uri: http://localhost:9080/auth/realms/jhipster/protocol/openid-connect/token
user-authorization-uri: http://localhost:9080/auth/realms/jhipster/protocol/openid-connect/auth
client-id: web_app
client-secret: web_app
client-authentication-scheme: form
scope: openid profile email
resource:
filter-order: 3
user-info-uri: http://localhost:9080/auth/realms/jhipster/protocol/openid-connect/userinfo
token-info-uri: http://localhost:9080/auth/realms/jhipster/protocol/openid-connect/token/introspect
prefer-token-info: false
jwt:
key-uri: http://localhost:9080/auth/realms/jhipster
Yes, what @mraible says is in the documentation -> closing this as this is not a bug.
Then I know the documentation isn't good enough, we have an opened ticket for that, but we just lack the time to write it.
I did some digging and finally found it - I am glad you will be improving the documentation in this regard. Thanks.
This fixed #6723
Hi @ThomasWilhelmUR , why don't you just put the answer and what you found ?
@ThomasWilhelmUR and @jdubois Really, why don't you put the answer here, I am having the exact issue and I have to dig around
Hi, @sslgeorge @issamm ,
@mraible told what to do in order to make it work: edit your /etc/hosts file and add an entry like
127.0.0.1 keycloak
@issamm @sslgeorge : just check our website -> https://www.jhipster.tech/docker-compose/#-keycloak
Overview of the issue
In a microservice environment running in docker using the new Keycloak feature, the sign in links will take you here: http://keycloak:9080/auth/realms/jhipster/protocol/openid-connect/auth?client_id=web_app&redirect_uri=http://localhost:8080/login&response_type=code&scope=openid%20profile%20email&state=2HNh2B
Motivation for or Use Case
Testing the new Keycloak integration.
Reproduce the error
How I did it / how to reproduce:
Related issues
When changing "keycloak:9080/" to "localhost:9080/" there is another error.
6723
Suggest a Fix
Clicking "sign in" in the gateway should take you to "localhost:9080".
JHipster Version(s)
4.10.2
JHipster configuration
Service:
Gateway:
Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryBrowsers and Operating System
Windows, Chrome/FF