I have a Flask web running at localhost:3000 using auth0 authentication.
After a successful authentication, I have an access_token, which can be used to access custom APIs, such as /api/calendar, /api/contacts etc.
In addition to that, I wish to have a user with admin role to access endpoints /api/admin/XXX. I can use scope for admin users, and protecting these endpoints is no problem.
However, I also want to access the endpoint provided by Management API via redirection, for example, localhost:3000/api/users redirected to https://{tenant}.auth0.com/api/v2/users
The tricky part is that the access token I get from the authentication is no good for accessing Management APIs. It seems that I need to get another access token with “client_credentials” grant type.
So I got an additional access token for an admin user, but how do I use it? When I use redirect({tenant}.auth0.com/api/v2/users), it still bears the original access token, not the new one.
What would be the best solution?
I came across this page (Use the Management API from within Rules), and wonder if this is relevant?