3 microservices need to communicate(exhanging data) with the help of RestTemplate.
For that i have developed a,b,c microservices respectivly. They registered with eureka server
and routing requests through api-gateway
api-gateway – 8080
ereka-service – 8761
authentication-service – 8081
microserviceA – 9091
microserviceB – 9092
microserviceC – 9093
In authentication-service i have generated JWT token and validating. And Filter i have defined
in api-gateway to intercept all the request’s for validating the header contains JWT token or not ?
If present filter will route the request with JWT token as in headers.
Here my question is i need to validate the JWT token and proceed to call my service endpoints
Note: spring boot 3.3.2 version, added security related and jwt related dependencies spring security, jjwt-api, jjwt-jakson, jjwt-impl
Can some one please look and guide me the best solution
And also should i do the same implementation for all the microservices to validate JWT ?
In realtime how this(internal communication of micorservices security) will happen ? getting JWT token
from the header and validating it and proceeding ?
I can able to get the token from the api-gateway filter and i need to validate that in my microservice and proceed. How can i achieve this ?
Vijay Chennam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.