如何使用JHipster Registry [Docker]修复无效的JWT? [英] How to fix Invalid JWT with JHipster Registry [Docker]?
问题描述
我想用JHipster构建微服务软件.我正在Docker中运行jhipster-registry:v3.2.4,我也有一个微服务应用程序(使用生成器5.0.1创建),但是我没有生成网关应用程序.
I want to build a microservices software with JHipster. I'm running jhipster-registry:v3.2.4 into Docker, i also have a microservice application (create with generator 5.0.1) but i do no generate a gateway application.
我在docker-compose.yml中使用:dev和native设置配置文件
I set the profiles in docker-compose.yml with: dev and native
我在Docker Compose文件中设置了JWT Secret.
I setted the JWT Secret in Docker Compose file.
我将配置文件添加到:Central-config文件夹
I added configurations files into : central-config folder
我将微服务的jwt设置为所有可能的* .yml文件
I setted the jwt for my microservice into all possible *.yml files
但是在注册表UI上,当我尝试访问微服务日志或指标时,出现异常:无效的JWT签名.
but on the registry UI, when i'm trying to access microservices logs or metrics, i got an Exception : Invalid JWT Signature.
推荐答案
在使用本机配置文件时,可以通过以下方式使用配置文件
SPRING_CLOUD_CONFIG_SERVER_NATIVE_SEARCH_LOCATIONS=file:./config/
在撰写的.yml和配置文件夹中,您添加了一个application.yml文件,
As you use the native profile, you can use a config file by setting
SPRING_CLOUD_CONFIG_SERVER_NATIVE_SEARCH_LOCATIONS=file:./config/
in your compose .yml and in a config folder, you add an application.yml file with
jhipster:
security:
authentication:
jwt:
secret: your secret
这篇关于如何使用JHipster Registry [Docker]修复无效的JWT?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!