I'm planning to implement an architecture where:
The API Gateway interacts with multiple services and a Vue.js frontend application. The API Gateway creates its own sessions linking user requests to stored tokens. The frontend uses session cookies to communicate with the API Gateway. Authentication is handled through Keycloak as the SSO provider. The goal is to keep the frontend unaware of the actual token, while maintaining security and flexibility.
Source of inspiration: https://medium.com/@a.zagarella/microservices-architecture-a-real-business-world-scenario-c77c31a957fb
The article describes the use of Spring Cloud Gateway, but in my case it will be api gateway on golang.
Example of a request for access to protected resources on a Resource Server:
What are some best practices for implementing this kind of setup? Are there any potential pitfalls I should be aware of?
This approach seems similar to what's described in the linked article, but I'd like to get more insights on how to implement it effectively.
Please provide guidance on:
How to securely store and manage tokens on the API Gateway Best practices for session management between frontend and API Gateway How to handle token refresh and expiration Any security considerations I should keep in mind I'm particularly interested in how to balance security, ease of use, and scalability in this architecture.
Thank you for your expertise!

