generator-jhipster: Unable to login using oAuth2/OKTA with docker-compose prod package - Error 'User could not be found'
Overview of the issue
Login doesn’t work with oAuth2/Okta using docker-compose: Error 500 - ‘User could not be found’. But, login works well when using keycloak instead of OKTA. The error occurred only with prod profile and docker-compose.
Motivation for or Use Case
Testing OIDC
Reproduce the error
- Generate o Monolith app with oAuth2 option
- Change OpenID Connect Settings to use OKTA instead of Keycloak: src/main/docker/app.yml and src/main/resources/application.yml
- build docker image using ‘./mvnw verify -Pprod dockerfile:build -DskipTests’
- Start app using ‘docker-compose -f src/main/docker/app.yml up -d’
Related issues
JHipster Version(s)
jhipster@5.0.0-beta.1
JHipster configuration, a .yo-rc.json file generated in the root folder
.yo-rc.json file
{
"generator-jhipster": {
"promptValues": {
"packageName": "com.test.monolith",
"nativeLanguage": "en"
},
"jhipsterVersion": "5.0.0-beta.1",
"baseName": "monolith",
"packageName": "com.test.monolith",
"packageFolder": "com/test/monolith",
"serverPort": "8080",
"authenticationType": "oauth2",
"cacheProvider": "hazelcast",
"enableHibernateCache": true,
"websocket": false,
"databaseType": "sql",
"devDatabaseType": "h2Disk",
"prodDatabaseType": "postgresql",
"searchEngine": false,
"messageBroker": false,
"serviceDiscoveryType": false,
"buildTool": "maven",
"enableSwaggerCodegen": false,
"clientFramework": "angularX",
"useSass": true,
"clientPackageManager": "yarn",
"applicationType": "monolith",
"testFrameworks": [],
"jhiPrefix": "jhi",
"enableTranslation": true,
"nativeLanguage": "en",
"languages": [
"en",
"fr"
]
}
}
Environment and Tools
java version “1.8.0_144” Java™ SE Runtime Environment (build 1.8.0_144-b01) Java HotSpot™ 64-Bit Server VM (build 25.144-b01, mixed mode)
git version 2.13.1 node: v8.11.1 npm: 5.6.0 yeoman: 2.0.0 yarn: 1.6.0 Docker version 18.03.0-ce, build 0520e24 docker-compose version 1.20.1, build 5d8c71b
Browsers and Operating System
- MacOS 10.13.4
- Chrome
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 17 (17 by maintainers)
If it doesn’t work in docker-compose, it might be caused by the variables set in src/main/docker/app.yml. If you already have them defined in src/main/resources/config/application.yml, there’s no need to override them in app.yml.
I’d try deleting the “SECURITY_OAUTH2_*” keys in app.yml and see if that fixes it.