我没有重现您的问题。这是我这一边的工作示例。
使用交互式身份验证提供程序
using Microsoft.Graph;
using Microsoft.Graph.Auth;
using Microsoft.Identity.Client;
using System;
namespace AzureTest
{
class Program
{
static void Main(string[] args)
{
string[] scopes = { "https://graph.microsoft.com/.default" };
IPublicClientApplication publicClientApplication = PublicClientApplicationBuilder
.Create("cbc3***-ac27-4532-802d-303998a6e712")
.Build();
InteractiveAuthenticationProvider authenticationProvider = new InteractiveAuthenticationProvider(publicClientApplication,scopes);
GraphServiceClient graphClient = new GraphServiceClient(authenticationProvider);
User me = graphClient.Me.Request()
.GetAsync().Result;
Console.Write(me.DisplayName);
}
}
}
使用机密客户端提供程序
using Microsoft.Graph;
using Microsoft.Graph.Auth;
using Microsoft.Identity.Client;
using System;
namespace AzureTest
{
class Program
{
static void Main(string[] args)
{
string[] scopes = { "https://graph.microsoft.com/.default" };
IConfidentialClientApplication confidentialClientApplication = ConfidentialClientApplicationBuilder
.Create("")
.WithRedirectUri("")
.WithClientSecret("")
.Build();
}
}
}
更新:
搜索软件包时,需要检查包括预发行版本。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句