Hi,
I have a .NET 8 Blazor WASM app and .NET API which I have successfully enabled Auth0 for, however I am trying to implement an endpoint to resend verification email but I’m receiving the following error when calling https://login.auth0.com/api/v2/jobs/verification-email
:
{
"statusCode": 401,
"error": "Unauthorized",
"message": "Bad audience: https://{myName}.uk.auth0.com/api/v2/"
}
I have created a M2M app that has access to the management API and has the correct scope to be able to call this endpoint. I am able to successfully retrieve an access token using the following params:
var requestContent = new FormUrlEncodedContent(new Dictionary<string, string>
{
{ "Content-Type", "application/x-www-form-urlencoded" },
{ "grant_type", "client_credentials" },
{ "client_id", settings.ClientId },
{ "client_secret", settings.ClientSecret },
{ "audience", "https://{myName}.uk.auth0.com/api/v2/" }
});
var response = await httpClient.PostAsync(TokenEndpoint, requestContent, cancellationToken);
Any help with this would be greatly appreciated.