修改/更新redirectUri?

时间:2015-10-20 08:22:36

标签: c#-4.0

private static async Task CreateApplication(string tenantId, string     
 clientId, string redirectUri)

 {
   var graphUri = new Uri("https://graph.windows.net");
   var serviceRoot = new Uri(graphUri, tenantId);
  var activeDirectoryClient = new ActiveDirectoryClient(serviceRoot,     
  async () => AcquireTokenAsyncForUser("https://login.microsoftonline.com/"    

     +      
tenantId, clientId, redirectUri));

var app = new Application
    {
        Homepage = "https://localhost",
        DisplayName = "My Application",
        LogoutUrl = "https://localhost",
        IdentifierUris = new List<string> {   
       "https://tenant.onmicrosoft.com/MyApp" },
          ReplyUrls = new List<string> { "https://localhost" }
      };

    await activeDirectoryClient.Applications.AddApplicationAsync(app);

    Console.WriteLine(app.ObjectId);
  }

0 个答案:

没有答案