I am looking for an optimal way to create registration, authentication, and authorization for our project based on spring boot microservices. Microservices will provide rest API for SPA application, and later for mobile applications (android and ios). Actually, we have all users in Postgres database.
As I mentioned user registration and authentication will be consumed by SPA and mobile platforms so I prefer RESTful API for that.
My idea is to have one auth-service which will resolve auth* actions, and also provide a public key for other microservices to decode and verify JWT.
In fact that we don't need to provide authorization to external services does make sense to use OIDC provider like Keycloak? Or custom authentication is a better option?