Hi, i am creating a code in which iam using auth0 for authentification (so i have my api and a regular application), and the thing is i want to use the management api in my api but the audience i have when a user connect is my api and the other is https://dev-dlblb59r.us.auth0.com/user/info and so i dont have the necessarry audience (https://dev-dlblb59r.us.auth0.com/api/v2/). which is why i get the “unauthorized” message from the managment api when i try to send a request.
so what i want to ask is can i add the necessary audience to my token(is it possible?) or should i go for another strategie.
Hello,
I don’t know if I got you well, but you should generate a token before executing a request in the management API.
To be honest, I couldn’t understand your problem, if you can share with us the code you’re executing it’d be better
i.e: that’s what I did to update user’s metadata via management API (in my API) using Axios:
so thats the simple class where i am going to call the management api with the httpclient
the headers authorization is going to be implemented with bearer token gotten from httpcontext
In my mvc app thats how ii implemented my auth0 authentification configuration
so what i tried so far is adding the audience necessary (which is https://dev-dlblb59r.us.auth0.com/api/v2/) in the appsetting but then again i have trouble with my configuration because my options.Audience in programs(in my api) becomes null.
so i want to add the audience in my token.
now i have those audiences in my token
i hoped it helped , and thanks again for the reply.