gpt4 book ai didi

.net - 将 UPN 分配给 Azure Active Directory 应用程序注册

转载 作者:行者123 更新时间:2023-12-04 10:58:51 25 4
gpt4 key购买 nike

我在Azure Active Directory中注册了应用程序,我们使用应用程序ID和 secret 来访问不同的资源,这里是请求访问 token 的示例代码

var authority = $"https://login.windows.net/TENANT_ID";
var authContext = new AuthenticationContext(authority, TokenCache.DefaultShared);
var clientCred = new ClientCredential("APP_ID", "APP_SECRET");
var result = await authContext.AcquireTokenAsync("RESOURCE_ID", clientCred);
Console.WriteLine(result.AccessToken);

但是其中一个系统要求我们在访问 token 中包含 UPN,这可能吗?是否可以为应用程序分配一些 UPN?

最佳答案

据我所知,您不能为应用程序分配 UPN。

您正在使用服务主体针对 Azure 进行身份验证。服务主体也有一个名称 - SPN,但没有用户主体名称。

enter image description here

关于.net - 将 UPN 分配给 Azure Active Directory 应用程序注册,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58970998/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com