Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// https://auth0.github.io/auth0.net/index.html
// https://auth0.github.io/auth0.net/api/Auth0.AuthenticationApi.Models.ClientCredentialsTokenRequest.html
public async void getapi2token(){
var AuthAPI = new AuthenticationApiClient(new Uri("https://shayan-dev.au.auth0.com/"));
var api2Response = await AuthAPI.GetTokenAsync(new ClientCredentialsTokenRequest
{
ClientId = "43BKVc57RgIiVJrbM8gRDIBQgofdByYe",
ClientSecret = "xxx",
Audience = string.Format("https://{0}/api/v2/", "shayan-dev.au.auth0.com")
});
System.Console.Write(api2Response.AccessToken.ToString() + "\n"); // This is our Access Token
var managementApi = new ManagementApiClient(api2Response.AccessToken.ToString(), new Uri(string.Format("https://{0}/api/v2", "shayan-dev.au.auth0.com")));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment