Hi,
I am trying to add conditional scopes for some users who have admin rights, but cannot seem to find an approach that works - any help would be appreciated.
I have tried a few approaches so far:
1.) First approach was done in code, in JS/Angular. In my Auth service component in the setSession method where I get the user information, I check if the user’s role is that of an Admin. If this is true, I add additional scopes to the existing, and call a webAuth.checkSession() with the new scopes - This fails with error “consent required”.
2.) Second approach was ment to be by using Rules, but I got kinda stuck on first step in this approach. First step is I wanted to add my “user role” to the user profile in Auth0, so in the Custom Database Login script’s callback, I add “user_metadata: { role: rows[0][2].value }” (also tried with just “metadata”), but this will not add anything to my user profile, so in my Rules I will never be able to check up on this value to determine if the scopes should stay as standard or have additional scopes added.
How can I proceed from here?
Thanks,
Nikolaj.