Skip to content

Instantly share code, notes, and snippets.

@buchizo
Created July 8, 2018 18:12
Show Gist options
  • Save buchizo/2f963cd4ff6a7e24fb0d7bb669d46bb2 to your computer and use it in GitHub Desktop.
Save buchizo/2f963cd4ff6a7e24fb0d7bb669d46bb2 to your computer and use it in GitHub Desktop.
AADToken
Console.Write("input your AzureAD tenant name: ");
var tenantName = Console.ReadLine();
Console.Write("input your media services endpoint: ");
var endpoint = Console.ReadLine();
Console.Write("input your client id: ");
var clientId = Console.ReadLine();
Console.Write("input your client secret: ");
var clientSecret = Console.ReadLine();
var tokenCredentials = new AzureAdTokenCredentials(
tenant: tenantName, // Azure ADテナント名
clientSymmetricKey: new AzureAdClientSymmetricKey(
clientId: clientId, // Service Principal の ClientID
clientKey: clientSecret // Service Principal の Secret
),
azureEnvironment: AzureEnvironments.AzureCloudEnvironment
);
var tokenProvider = new AzureAdTokenProvider(tokenCredentials);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment