首页 > 解决方案 > 站点 id = 2 的 Shibboleth SP 配置无法使其正常工作

问题描述

我有一个非常简单的问题,我无法解决,我觉得自己很愚蠢。我正在尝试为 IIS 托管的网站运行用于 SSO 的 Shibboleth SP3。

我在 IIS 下使用 index.aspx 配置示例网站 1。

我将 ISAPI 和 RequestMap 配置如下:

<InProcess logger="native.logger">
    <ISAPI normalizeRequest="true" safeHeaderNames="true">           
    <Site id="1" name="localhost" scheme="http" port="80"/>
    </ISAPI>    
</InProcess>
<RequestMapper type="Native">
    <RequestMap>
        <Host name="localhost">
           <Path name="secure" authType="shibboleth" requireSession="true" />
</RequestMap>

它运作良好,我被重定向到 Idp,我的声明被提取。现在我想在 IIS 中使用另一个站点,ID 为 2。这是我的配置:

<InProcess logger="native.logger">
    <ISAPI normalizeRequest="true" safeHeaderNames="true">           
    <Site id="2" name="localhost" scheme="http" port="81"/>
    </ISAPI>    
</InProcess>
<RequestMapper type="Native">
    <RequestMap>
        <Host name="localhost">
           <Path name="secure" authType="shibboleth" requireSession="true" />
</RequestMap>

该 ID 与 IIS 上的站点 ID 匹配。我删除了第一个站点的配置以避免在此阶段出现问题。现在,在重新启动 IIS 和 shib_default 服务后,当我输入http://localhost:81/secure/index.html时,我没有被重定向到我的 IDP。

为什么 ?有什么我做错了吗?

标签: single-sign-onshibboleth

解决方案


您正在尝试保护两个不同的 localhost http 侦听器,但我认为这不受支持。我这样做的方法是将site1.dev和添加site2.dev到您的主机文件,并更改 IIS 配置,以便将 site1.dev 断言为站点 #1 的主机名,反之亦然。

然后,您的 shibboleth 配置将如下所示:

<InProcess logger="native.logger">
    <ISAPI normalizeRequest="true" safeHeaderNames="true">
        <Site id="1" name="site1.dev" scheme="http" port="80"/>           
        <Site id="2" name="site2.dev" scheme="http" port="80"/>
    </ISAPI>    
</InProcess>
<RequestMapper type="Native">
    <RequestMap>
        <Host name="site1.dev">
           <Path name="secure" authType="shibboleth" requireSession="true" />
        </Host>
        <Host name="site2.dev">
           <Path name="secure" authType="shibboleth" requireSession="true" />
        </Host>
    </RequestMap>
</RequestMapper>

基本上,如果您尝试使用 Shib 在非标准端口 (81) 上运行 HTTP,事情会变得很奇怪。我从未见过有人这样做,即使在开发环境中也是如此。无论如何,您不能有多个<InProcess>,<ISAPI><RequestMapper>元素。

编辑:我认为您甚至可能需要为您正在做的事情定义多个 ApplicationOverrides。


推荐阅读