ADFS 2.0 httpcontext.current.user.identity.name 为空

发布于 2024-12-29 16:56:46 字数 376 浏览 7 评论 0原文

我正在使用 ADFS 2.0 和 .net 2.0 Web 应用程序 我试图在我的网络应用程序上获取 httpcontext.current.user.identity.name 但它是空的。我需要设置什么声明规则才能获得这个值? 我试过了 转换传入的索赔 传入声明类型:AD FS 1.x UPN 传出声明类型:姓名 ID 传出名称 ID 格式:UPN

我也尝试过 将 LDAP 属性作为声明发送 属性存储:Active Directory

LDAP 属性传出声明类型 SAM 帐户名称 SamAccountName 令牌组-无资格名称组 用户主体名称 AD FS 1.x UPN

我的代码用于使用 ADFS 1.0,我将 fs url 更改为 adfs2.0,然后我开始看到此问题。

i am using ADFS 2.0 with .net 2.0 web applciation
i am trying to get httpcontext.current.user.identity.name on my web application but it comes as empty. what claims rule do i need to set to get this value?
i have tried
Transform Incoming Claim
Incoming Claim type: AD FS 1.x UPN
Outgoing Claim Type: Name ID
Outgoing name ID format : UPN

i have also tried
send Ldap Attributes as Claims
Attribute STore:Active Directory

LDAP-Attribute Outgoing Claim Type
SAM-Account-Name SamAccountName
Token-Groups- Unqailfied Names Group
User-Principal-Name AD FS 1.x UPN

my code used to work with ADFS 1.0 i changed the fs url to adfs2.0 and i started to see this issue.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

柠檬色的秋千 2025-01-05 16:56:46

您是否尝试过“名称”的传递规则?

Have you tried a pass through rule of "Name"?

恋你朝朝暮暮 2025-01-05 16:56:46

您需要通过 nzpcmad 建议。或者,在 Web 应用程序的 WIF 配置中,您可以将 NameClaimType 设置为默认值以外的其他值(因此,“Name”是默认值)。然后,它将使用该类型的声明来填充线程主体标识的 Name 属性。

You'll need to send the "Name" claim through as nzpcmad suggests. Alternatively, in your web app's WIF configuration you can set the NameClaimType to something other than the default ("Name" is the default, hence). It will then use a claim of that type to fill the Name property on the thread's principal identity.

哑剧 2025-01-05 16:56:46

有时,您需要为您的域安装证书才能使身份流程正常运行,之后您应该会看到声明。

Sometimes you need to install a certificate for your domain in order to get the identity process working, after which you should see the claims.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文