Invalid_token from authorization and using via management api

I am trying to get auth through the authorization endpoint and then use that token in the management endpoint, but every time I do, I get an invalid_token error. I am using C# through the auth0 nuget packages (auth0, auth0.authorization, auth0.management). I am using .net core 3.1.

How I am getting the token. I have used the restREponse way as well, and have the same results

AuthenticationApiClient authenticationApiClient = new AuthenticationApiClient(new Uri("{Authority}")); var request = new ClientCredentialsTokenRequest { Audience = "{Authority}/api/v2/",
ClientId = ClientId,
ClientSecret = ClientSecret
};
var token = authenticationApiClient.GetTokenAsync(request);
token.Wait();
_apiClient = new ManagementApiClient(token.Result.AccessToken, new Uri($"{_settings.Auth0.Authority}/api/v2/"));

I get the token and the api client seems to fill in just fine, but then when I try to call any endpoint I get an invalid token

_apiClient.Users.CreateAsync(new Auth0.ManagementApi.Models.UserCreateRequest()
{
Email = EmailAddress,
EmailVerified = false,
Password = Password,
Connection = Connection
});

When I use the api token from the api explorer, it works easy peasy but I don’t want to do that for production. So the permissions seem to be right. When I copy and paste the token from my code into the api explorer, I get the same invalid_token, so there must be something wrong with the way I am getting the token, but I cannot figure out what I am doing wrong. I do notice that when I put in a token that I get this way, the allowed scopes section in the api explorer, has no scopes. If there is anything I have left out or any questions you have, please let me know, I am outta ideas.

Hi lovejotd,

Could you message the payload of your token to me to have further investigation? DO NOT send your token to me or post it here.
You can use jwt.io to extract the payload of a jwt token.

I believe this is what you want, let me know if this is wrong

https://jwt.io/#debugger-io?token=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjEya3RJZnUyWmFFR00zNUxudVZZOSJ9.eyJpc3MiOiJodHRwczovL2tleW1hc3RlcjEudXMuYXV0aDAuY29tLyIsInN1YiI6InE1SEFPbkVENlczc2wwMlZhWWlGTGRtVTY0bWM0WFlyQGNsaWVudHMiLCJhdWQiOiJodHRwczovL2tleW1hc3RlcjEudXMuYXV0aDAuY29tL2FwaS92Mi8iLCJpYXQiOjE2MDI0NjI2MTYsImV4cCI6MTYwMjU0OTAxNiwiYXpwIjoicTVI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