我正在用Jhipster创建一个应用程序。为此,我要使用Keycloak身份验证服务器。但是,一旦我登录,就会收到以下消息: 状态:内部服务器错误(内部服务器错误) 消息:尝试解码Jwt时发生错误:Jwt在2019-06-04T00:20:05Z过期
我的.yo-rc.json:
{
"generator-jhipster": {
"promptValues": {
"packageName": "com.mycompany.front.project",
"nativeLanguage": "fr"
},
"jhipsterVersion": "6.0.1",
"applicationType": "gateway",
"baseName": "frontProduit",
"packageName": "com.mycompany.front.project",
"packageFolder": "com/mycompany/front/project",
"serverPort": "8080",
"authenticationType": "oauth2",
"cacheProvider": "ehcache",
"enableHibernateCache": true,
"websocket": false,
"databaseType": "sql",
"devDatabaseType": "postgresql",
"prodDatabaseType": "postgresql",
"searchEngine": false,
"messageBroker": false,
"serviceDiscoveryType": "consul",
"buildTool": "maven",
"enableSwaggerCodegen": false,
"clientFramework": "angularX",
"clientTheme": "none",
"clientThemeVariant": "",
"useSass": true,
"clientPackageManager": "npm",
"testFrameworks": [],
"jhiPrefix": "jhi",
"entitySuffix": "",
"dtoSuffix": "DTO",
"otherModules": [],
"enableTranslation": true,
"nativeLanguage": "fr",
"languages": [
"fr",
"en"
]
}
}
答案 0 :(得分:4)
这个问题困扰了我3天,但我终于明白了。这与本地Docker客户端时间与操作系统不同步有关。当您使计算机进入睡眠状态时,尤其会发生这种情况。那时Docker经历了“时间漂移”。解决方案是在运行Keycloak映像之前重新启动Docker客户端。
如果您在另一台计算机上运行Keycloak,则必须为运行Java服务器的计算机设置相同的日期时间。