【发布时间】:2018-11-07 14:42:39
【问题描述】:
我想调用图形 api,https://graph.windows.net,因为我正在使用如下授权的令牌
UserPasswordCredential credentials = new UserPasswordCredential("username", "password");
AuthenticationContext authContext = new AuthenticationContext(string.Format("https://login.windows.net/{0}", "mytenant.onmicrosoft.com"));
var accessToken = authContext.AcquireTokenAsync("https://graph.windows.net", clientId, credentials).Result.AccessToken;
我不是租户管理员,并且在 AAD 中,我无法将特定应用程序添加为应用程序身份验证的所有者。这是在完整的 .net 中工作的,在 .net 标准中是否有解决方法?因为在这种情况下我不能使用应用程序身份验证。
我正在尝试将 webjob 转换为 Azure 函数。
【问题讨论】:
-
令牌有什么用?您可以使用
Managed Identity,因此您不必指定凭据:blogs.msdn.microsoft.com/benjaminperkins/2018/06/13/…
标签: c# .net-core azure-active-directory azure-functions .net-standard