I'm designing a microservices-based architecture. The architecture should support multiple devices accessing the API.
In order to secure the internal Resource APIs, I wanted to implement authentication and authorization based on JWTs and Refresh Tokens.
My requirements are:
This is what I came with:
Few details:
Will this architecture actually work? will it be secure? Thank you very much! 😊
Tokens are actually harder to secure from JavaScript than pure cookies that we have several mature ways to protect from JavaScript (like Secure, HttpOnly, SameSite...).
I think you should keep your architecture less complex by using the same technique everywhere for both mobile and browsers. As both types are considered to be insecure public clients.
also, a hint, it can be interesting for you to explore how existing application deal with this using a tool like Fiddler to capture all the mobile traffic and explore how they deal with login, session and signout.
see https://docs.telerik.com/fiddler/configure-fiddler/tasks/configureforios