If I have multiple applications and want to use a single auth microservice how should I handle the role based access control?
Let's assume I send a credential object back to the user that carries the different tokens, userid and the domain(application the user signed into). Something like:
Credential {
String userid;
string domain; // defines which application the user has signed up for
string signature;
.....
}
A game might not have multiple roles but a ecommerce application will definitely have roles like owner, salesman, manager etc.
So how can this issue be solved if I wanted to have a centralized auth service?
A bit more explanation:
Let's assume I have 3 applications:
- Game
- Ecommerece
- A blog site like medium
Each of them are separate microservice on their own. And I want to implement a central auth microservice for all of this application.
So a game might not have lot of roles but ecommerece and blog site may have admin, moderators, shop owners, salesman etc etc.
Since the auth microservice has no way to know how many applications I might have in future I cannot implement the RBAC part in auth service right?
So if my auth service only handles the authentication how can I solve the authorization part?