Azure SDK:PublicClientApplicationBuilder class 的用途是什么?微软文档没有给出定义
Azure SDK: What PublicClientApplicationBuilder class is for? Microsoft doc does not give a definition
使用 Azure SDK for .NET, I am trying to understand PublicClientApplicationBuilder class 开发 .NET Core
应用时。官方链接文档没有定义这个 class 的作用。该文档仅给出了其方法。在线搜索也没有提供定义。 问题:这个class是做什么的?
它在 Azure AD 中实例化一个 public 客户端应用程序,例如使用 Build()
如下所示。
IPublicClientApplication app = PublicClientApplicationBuilder.Create(clientId)
.Build();
它 returns IPublicClientApplication
, then you can use the methods 做某事,例如获取访问令牌。
下面的示例使用交互式方式通过登录用户获取 Micrsoft Graph 的令牌:
var scopes = new List<string>() { "https://graph.microsoft.com/.default" };
var token = await app.AcquireTokenInteractive(scopes).ExecuteAsync();
使用 Azure SDK for .NET, I am trying to understand PublicClientApplicationBuilder class 开发 .NET Core
应用时。官方链接文档没有定义这个 class 的作用。该文档仅给出了其方法。在线搜索也没有提供定义。 问题:这个class是做什么的?
它在 Azure AD 中实例化一个 public 客户端应用程序,例如使用 Build()
如下所示。
IPublicClientApplication app = PublicClientApplicationBuilder.Create(clientId)
.Build();
它 returns IPublicClientApplication
, then you can use the methods 做某事,例如获取访问令牌。
下面的示例使用交互式方式通过登录用户获取 Micrsoft Graph 的令牌:
var scopes = new List<string>() { "https://graph.microsoft.com/.default" };
var token = await app.AcquireTokenInteractive(scopes).ExecuteAsync();