- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我觉得我已经四处寻找应该是简单配置的东西:结果一无所获。
我是 Shibboleth 的新手,虽然我曾使用过一些 CAS,但强度不大。我已将其设置(按照指南:https://wiki.jasig.org/display/CASUM/Shibboleth-CAS+Integration)以便 Shibboleth 重定向到 CAS 进行身份验证。这工作正常,一旦用户通过身份验证,他们就会通过 Shibboleth 进行重定向,并发送 SAML 响应。我正在使用 https://sp.testshib.org 进行测试并且它正在正确接收响应并显示页面。
我似乎无法弄清楚的是如何仅发布一个简单的属性以及用于登录 CAS 的用户名。我知道 Shibboleth 看到了它(来自 idp-process.log),但我不知道要在 attribute-resolver.xml 和 attribute-filter.xml 中放入什么来发布它。
当前的 SAML 响应如下所示:
<?xml version="1.0" encoding="UTF-8"?><saml2:Assertion xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" ID="_da56752846e00c2693ece2c486d7c870" IssueInstant="2012-11-16T14:08:07.570Z" Version="2.0">
<saml2:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">https://<idpurl>/idp/shibboleth</saml2:Issuer>
<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<ds:SignedInfo>
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
<ds:Reference URI="#_da56752846e00c2693ece2c486d7c870">
<ds:Transforms>
<ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
</ds:Transforms>
<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<ds:DigestValue>7OHKEiEQ0ZcPDcnt4B8PIGoLEfw=</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
<ds:SignatureValue>S3FZI+KpNf8wUYWMA96ccAj0Y5ebojB1xKHlixHWNEr4voqHOGSpBzxdui0IVtUwLEzj4RrDFdYarJaZj6ltzFV4hfNx5bN88zYQG6w9BBP9UybG+81Wrhii2O31AmRz2Y6XIqa72CeN2R4DKo70awn6FXIPLAcEKs+7dAG2lQ87VS3Wv126DghE/eGcMLW6+z9a3MxXtUFSmWYosaIbNREJn4mGO/uGzD27eeo6SNmvBx/BgVh7T2cOIbtD8b9OOZT8Urt0kZ2nsoCZHgp1T0V6ZgnE2TDvPTInrxzC5c4S+YOYZlB0ijMI6pk+PpJGshe7MVUcEO34Nn0I3i0OUw==</ds:SignatureValue>
<ds:KeyInfo>
<ds:X509Data>
<ds:X509Certificate><!--Valid Certificate--></ds:X509Certificate>
</ds:X509Data>
</ds:KeyInfo>
</ds:Signature>
<saml2:Subject>
<saml2:NameID Format="urn:oasis:names:tc:SAML:2.0:nameid-format:transient" NameQualifier="https://<idpurl>/idp/shibboleth" SPNameQualifier="https://sp.testshib.org/shibboleth-sp">_4b1a2780b2ce3db36ea7e7f6192b7108</saml2:NameID>
<saml2:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer">
<saml2:SubjectConfirmationData Address="<valid ip address>" InResponseTo="_aa4e23dd783eddb1be18ad224c26e7cf" NotOnOrAfter="2012-11-16T14:13:07.570Z" Recipient="https://sp.testshib.org/Shibboleth.sso/SAML2/POST"/>
</saml2:SubjectConfirmation>
</saml2:Subject>
<saml2:Conditions NotBefore="2012-11-16T14:08:07.570Z" NotOnOrAfter="2012-11-16T14:13:07.570Z">
<saml2:AudienceRestriction>
<saml2:Audience>https://sp.testshib.org/shibboleth-sp</saml2:Audience>
</saml2:AudienceRestriction>
</saml2:Conditions>
<saml2:AuthnStatement AuthnInstant="2012-11-16T14:08:07.554Z" SessionIndex="00568a153d3cccf9c17abf2c77a043ed8b74a74fe5e2c61000590269aa87f99a">
<saml2:SubjectLocality Address="<valid ip address>"/>
<saml2:AuthnContext>
<saml2:AuthnContextClassRef>urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport</saml2:AuthnContextClassRef>
</saml2:AuthnContext>
</saml2:AuthnStatement>
</saml2:Assertion>
我只需要一个示例来说明如何进行此设置。我已经阅读了 wiki.shibboleth.net 上的所有文档,但似乎仍然无法理解。
提前非常感谢您的帮助,我知道这只是一个配置问题,但这让我的大脑感觉很愚蠢,我什至没有尝试过与比 TestShib 更激烈的东西集成!
编辑:我发现这个设置指南有部分帮助,我能够通过搜索事件目录将名称作为属性传递出去,但这不是一个合适的长期解决方案,因为 CAS 可以检查多个用户存储库,并且它不一定与这将检查以获取它的相同。我只想将 ${requestContext.principalName} 作为属性发布。
有什么更好的主意吗?也许是静态连接器,但我不确定如何让它解析 ${requestContext.principalName}?
最佳答案
最后我想通了。在此发布解决方案,以供遇到此问题并迷失在本应简单的细节沼泽中的任何其他人使用。
在 Shibboleth 的 attribute-resolver.xml 文件中,我必须添加以下解析器:
<resolver:AttributeDefinition id="principal" xsi:type="PrincipalName" xmlns="urn:mace:shibboleth:2.0:resolver:ad">
<resolver:AttributeEncoder
xsi:type="SAML1String"
xmlns="urn:mace:shibboleth:2.0:attribute:encoder"
name="urn:mace:dir:attribute-def:principal" />
<resolver:AttributeEncoder
xsi:type="SAML2String"
xmlns="urn:mace:shibboleth:2.0:attribute:encoder"
name="urn:oid:1.3.6.1.4.1.5923.1.1.1.1"
friendlyName="principal" />
</resolver:AttributeDefinition>
在 attribute-filter.xml 中我需要添加以下过滤器:
<AttributeFilterPolicy id="releaseBasicAttributesToAnyone">
<PolicyRequirementRule xsi:type="basic:ANY"/>
<AttributeRule attributeID="principal">
<PermitValueRule xsi:type="basic:ANY" />
</AttributeRule>
</AttributeFilterPolicy>
如果您不想将本金释放给每个 SP,请更改您的策略要求规则。
令人惊讶的是,如此简单的事情似乎并没有在任何地方被清楚地记录下来。我查看 shibboleth 文档的时间比本应花费的时间长,最终在有人发布的关于想要更改 PrincipalName 的值的 Google 群组帖子中找到了线索。
我希望这对其他人有帮助!
关于attributes - CAS 和 Shibboleth Integration 将主体名称(用户名)作为 SAML 中的一个属性发布,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13418596/
你能比较一下属性吗 我想禁用文本框“txtName”。有两种方式 使用javascript,txtName.disabled = true 使用 ASP.NET, 哪种方法更好,为什么? 最佳答案 我
Count 属性 返回一个集合或 Dictionary 对象包含的项目数。只读。 object.Count object 可以是“应用于”列表中列出的任何集合或对
CompareMode 属性 设置并返回在 Dictionary 对象中比较字符串关键字的比较模式。 object.CompareMode[ = compare] 参数
Column 属性 只读属性,返回 TextStream 文件中当前字符位置的列号。 object.Column object 通常是 TextStream 对象的名称。
AvailableSpace 属性 返回指定的驱动器或网络共享对于用户的可用空间大小。 object.AvailableSpace object 应为 Drive 
Attributes 属性 设置或返回文件或文件夹的属性。可读写或只读(与属性有关)。 object.Attributes [= newattributes] 参数 object
AtEndOfStream 属性 如果文件指针位于 TextStream 文件末,则返回 True;否则如果不为只读则返回 False。 object.A
AtEndOfLine 属性 TextStream 文件中,如果文件指针指向行末标记,就返回 True;否则如果不是只读则返回 False。 object.AtEn
RootFolder 属性 返回一个 Folder 对象,表示指定驱动器的根文件夹。只读。 object.RootFolder object 应为 Dr
Path 属性 返回指定文件、文件夹或驱动器的路径。 object.Path object 应为 File、Folder 或 Drive 对象的名称。 说明 对于驱动器,路径不包含根目录。
ParentFolder 属性 返回指定文件或文件夹的父文件夹。只读。 object.ParentFolder object 应为 File 或 Folder 对象的名称。 说明 以下代码
Name 属性 设置或返回指定的文件或文件夹的名称。可读写。 object.Name [= newname] 参数 object 必选项。应为 File 或&
Line 属性 只读属性,返回 TextStream 文件中的当前行号。 object.Line object 通常是 TextStream 对象的名称。 说明 文件刚
Key 属性 在 Dictionary 对象中设置 key。 object.Key(key) = newkey 参数 object 必选项。通常是 Dictionary 
Item 属性 设置或返回 Dictionary 对象中指定的 key 对应的 item,或返回集合中基于指定的 key 的&
IsRootFolder 属性 如果指定的文件夹是根文件夹,返回 True;否则返回 False。 object.IsRootFolder object 应为&n
IsReady 属性 如果指定的驱动器就绪,返回 True;否则返回 False。 object.IsReady object 应为 Drive&nbs
FreeSpace 属性 返回指定的驱动器或网络共享对于用户的可用空间大小。只读。 object.FreeSpace object 应为 Drive 对象的名称。
FileSystem 属性 返回指定的驱动器使用的文件系统的类型。 object.FileSystem object 应为 Drive 对象的名称。 说明 可
Files 属性 返回由指定文件夹中所有 File 对象(包括隐藏文件和系统文件)组成的 Files 集合。 object.Files object&n
我是一名优秀的程序员,十分优秀!