I've been working on a webapp using Spring Boot that uses microservices.
It contains:
- A Spring Cloud Gateway service to access other internal microservices
- Authorization service for managing security stuff using JWT tokens
- Other various internal services
The way I've set up my security thingie is that, in the Spring Gateway, I've made a filter that reads the bearer token from the request and verifies it using the authorization microservice. If the token is valid, the request passes further, otherwise it throws 401. The route builder is then configured to have the filter applied to specific endpoints in the gateway. The actual endpoints on the internal services, for the exception of auth service, remain unsecured.
I plan on (eventually) deploying said app using Kubernetes and while, as far as I'm aware, there shouldn't be any issues with this setup if I configure the cluster correctly (API authentication, RBAC, etc.), I'd like to double check if this is true or not.
And, in the case it isn't, what's the better method for securing microservices?