gpt4 book ai didi

attributes - Shibboleth - 如何读取属性?

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

我使用 Shibboleth 成功登录到我的服务提供商测试页面。然后我转到/Shibboleth.sso/Session 页面,我看到以下内容:

Attributes
affiliation: 1 value(s)
entitlement: 1 value(s)
eppn: 1 value(s)
persistent-id: 1 value(s)
unscoped-affiliation: 1 value(s)

我的问题是……我该如何阅读这些值?我在 Fiddler 的 HTTP 请求 header 中没有看到它们。

我的 Web 应用程序将在 ASP.NET MVC 4 (C#) 中实现。

最佳答案

您可以使用 读取 IdP 发送的 Shibboleth SAML 属性。 Request.ServerVariables 目的:

string server = Request.ServerVariables["HTTP_FIRSTNAME"];

this如果要列出并打印 session 中的所有属性。
记得配置Shibboleth 属性映射.xml 处理您的 IdP 可能发送的自定义属性:
<Attribute name="firstname" id="firstname" nameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified">
<AttributeDecoder xsi:type="StringAttributeDecoder"/>
</Attribute>

关于attributes - Shibboleth - 如何读取属性?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18500489/

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