Hi,
I’m using the following code to try to get an access token for using the management API:
string auth0Domain = "mydomain.au.auth0.com";
var auth0AuthenticationClient = new AuthenticationApiClient(
new Uri(String.Format("https://{0}", auth0Domain)));
var tokenRequest = new ClientCredentialsTokenRequest()
{
ClientId = "my client id",
ClientSecret = "my client secret",
Audience = String.Format("https://{0}/api/v2", auth0Domain),
};
var tokenResponse =
await auth0AuthenticationClient.GetTokenAsync(tokenRequest);
However I get the following error:
Client is not authorized to access
“https:/mydomain.au.auth0.com/api/v2”.
You might probably want to create a
“client-grant” associated to this API.
See:
Auth0 Management API v2
I googled that error and found this question:
http://community.auth0.com/questions/1626/how-to-generate-a-management-api-token-automatical
However I have already done all of those steps, ie created a non-interactive client, authorized the client for the management API, and configured some scopes.
Any ideas what else I could be missing?
Thanks,
Saxon