I have an application where I want a user working as administrator for 2 companies to login and have the possibility to switch his context in the application :
- when he is in the context of the company 1, he could add , modify , update the products
- when he switch to the context of the company 2 (always with the same account and without relogging), he could only consult the products and add new ones.
My application is a spa application using a backend product api. I am trying to retireve an access token containing all the permissions by companies… But I do not know how to do it, neither if this is the best way to solve my problem.
What solution Auth0 could provide for this type of problem ?