How to fix Invalid JWT with JHipster Registry [Doc

2020-03-31 04:21发布

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.

I set the profiles in docker-compose.yml with: dev and native

I setted the JWT Secret in Docker Compose file.

I added configurations files into : central-config folder

I setted the jwt for my microservice into all possible *.yml files

but on the registry UI, when i'm trying to access microservices logs or metrics, i got an Exception : Invalid JWT Signature.

2条回答
等我变得足够好
2楼-- · 2020-03-31 04:47

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
查看更多
倾城 Initia
3楼-- · 2020-03-31 05:09

You must add;
jhipster:
 security:
  authentication:
   jwt:
    secret:
or
jhipster:
 security:
  authentication:
   jwt:
    base64-secret: (JHipster v5.3.0+)
in application.yml or application.properties.

A little reminder. Secret must be longer than 256 bits.

查看更多
登录 后发表回答