Created
March 6, 2019 03:07
-
-
Save ShayMe21/d71533660189e808a342bf23b0626685 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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