簡體   English   中英

Shibboleth ACS URL與http和https不匹配

[英]Shibboleth ACS URL mismatch with http and https

我的ACS URL從https://foo.com/重寫為http://foo.com/ ,這導致以下異常。

Microsoft.IdentityServer.Service.Policy.PolicyServer.Engine.AssertionConsumerServiceUrlDoesNotMatchPolicyException:MSIS3200:在依賴方信任'foo-shibboleth-sp'上未配置AssertionConsumerService,這是AssertionConsumerService URL'http: // foo / Shibboleth的前綴匹配。 sso / SAML2 / POST '由請求指定。

日志消息反映出auth請求也以http發送:

<samlp:AuthnRequest xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" 
AssertionConsumerServiceURL="http://foo/Shibboleth.sso/SAML2/POST" 
Destination="https://bar/adfs/ls/" 
ID="_12345ID" IssueInstant="2017-08-08T22:24:28Z" 
ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" 
Version="2.0"><saml:Issuerxmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">foo-shibboleth-sp</saml:Issuer><samlp:NameIDPolicy AllowCreate="1"/></samlp:AuthnRequest>
2017-08-08 22:24:28 DEBUG OpenSAML.MessageEncoder.SAML2Redirect [1]: message encoded, sending redirect to client

我在下面包括了我的配置。

我在IDP中配置的SP元數據具有正確的URL和https,但已更改為下游的http,可以在samlp身份驗證請求的Shibboleth日志中看到。

如果我將handlerSSL切換為TRUE,則samlp auth請求中的ACS URL將顯示https。 但是,將其設置為TRUE時,/ Shibboleth.sso /路徑中的任何內容(例如/ Status或/ SAML2 / POST)都是404ing。

我還應注意,這實際上是網站遷移,並且全部在數據中心的Windows上,而現在在AWS的Linux上。 負載平衡器可能存在一個問題,即我們終止SSL,但無法對其進行調試。

在提供給IDP的SP元數據中,我指定https / SAML2 / POST URL。 這里有很多配置,但是我試圖突出顯示相關內容。

<md:EntityDescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" ID="_97e389f1c212...." entityID="foo-shibboleth-sp">

...

<init:RequestInitiator xmlns:init="urn:oasis:names:tc:SAML:profiles:SSO:request-init" Binding="urn:oasis:names:tc:SAML:profiles:SSO:request-init" Location="https://foo/Shibboleth.sso/Login"/>

....

<md:AssertionConsumerService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="https://foo/Shibboleth.sso/SAML2/POST" index="10"/>

然后,在我的SP上的shibboleth2.xml中,我有以下應用程序覆蓋配置:

        <ApplicationOverride id="lms" entityID="foo-shibboleth-sp"
                         homeURL="/path/to/sso/location">

        <Sessions lifetime="28800" timeout="3600" checkAddress="false"
            handlerURL="/Shibboleth.sso" handlerSSL="false"
            exportLocation="https://foo/Shibboleth.sso/GetAssertion" exportACL="127.0.0.1"
            idpHistory="false" idpHistoryDays="7">

            <!-- Default example directs to a specific IdP's SSO service (favoring SAML 2 over Shib 1). -->
            <SessionInitiator type="Chaining" Location="/Login" isDefault="true" id="Intranet"
                    relayState="cookie" entityID="http://bar/adfs/services/trust">
                <SessionInitiator type="SAML2" acsIndex="1" template="bindingTemplate.html"/>
                <SessionInitiator type="Shib1" acsIndex="5"/>
            </SessionInitiator>
        </Sessions>

        <MetadataProvider type="XML" file="/etc/shibboleth/metadata-sp.xml"/>

        <!-- Map to extract attributes from SAML assertions. -->
        <AttributeExtractor type="XML" validate="true" path="/etc/shibboleth/attribute-map.xml"/>

    </ApplicationOverride>

最后,我確定的唯一可能造成問題的是IDP元數據:

<EntityDescriptor xmlns="urn:oasis:names:tc:SAML:2.0:metadata" ID="_1234-..." entityID="http://bar/adfs/services/trust">
...
      <AssertionConsumerService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="https://bar/adfs/ls/" index="0" isDefault="true" />
....
      <SingleSignOnService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" Location="https://bar/adfs/ls/" />
  <SingleSignOnService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="https://bar/adfs/ls/" />

apache的配置也,雖然它看起來很漂亮

<Location />
  ShibRequestSetting applicationId lms
</Location>
<Location /path/to/sso/location>
  ShibRequestSetting applicationId lms
  AuthType shibboleth
  ShibRequestSetting requireSession 1
  require valid-user
</Location>

問題最終與AWS Load Balancer的SSL卸載有關。 因為我們要在ELB終止,所以我們需要在Apache config中的ServerName指令上設置https://,以便它可以生成https自引用網址。

http://httpd.apache.org/docs/2.2/mod/core.html#servername

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM