미해결
Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
비대칭키 jwt 인증 문제
http://localhost:8888/ecommerce/default 에서는 {name: "ecommerce",profiles: ["default"],label: null,version: "f45bf692a6cb54252ea12041f0aa92a71964a5f7",state: null,propertySources: [{name: "file:///C:\\Users\\ydj90\\Downloads\\git/file:C:\Users\ydj90\Downloads\git\ecommerce.yml",source: {token.expiration_time: 864000000,gateway.ip: "172.30.1.33",token.secret: "userToken_token"}}]}http://localhost:8888/user-service/default 에서는{name: "user-service",profiles: ["default"],label: null,version: "f45bf692a6cb54252ea12041f0aa92a71964a5f7",state: null,propertySources: [{name: "file:///C:\\Users\\ydj90\\Downloads\\git/file:C:\Users\ydj90\Downloads\git\user-service.yml",source: {spring.datasource.url: "jdbc:h2:mem:testdb",spring.datasource.driver-class-name: "org.h2.Driver",spring.datasource.generate-unique-name: false,token.expiration_time: 864000000,gateway.ip: "172.30.1.33",order_service.url: "http://ORDER-SERVICE/order-service/%s/orders",spring.datasource.username: "sa",token.secret: "userToken_token"}}]} 이와 같이 token.secret이 같은데 왜 subject가 null값이 되는지 이유를 알 수 가 없습니다. login하고 나온 header값을 가지고 bearer에 넣어 인증하는 방식이 아닙니까?이유를 잘 모르겠습니다. JWT token is not valid이게 왜 뜨는지subject = Jwts.parser().setSigningKey(env.getProperty("token.secret"))
.parseClaimsJws(jwt).getBody()
.getSubject(); 여기서 왜 null값으로 값을 반환하는지 이해를 할 수가 없습니다.