2017-08-09 57 views
0

我的ACS URL正在從https://foo.com/重寫爲http://foo.com/這是導致下面的異常。Shibboleth ACS URL與http和https不匹配

Microsoft.IdentityServer.Service.Policy.PolicyServer.Engine.AssertionConsumerServiceUrlDoesNotMatchPolicyException:MSIS3200:沒有AssertionConsumerService是在信賴方信任「富-陳詞濫調-SP」是的AssertionConsumerService URL「http://foo/Shibboleth.sso/SAML2/POST」的前綴匹配配置由請求指定。

日誌信息反映了身份驗證請求爲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元數據具有https的正確URL,但正在下游的某處更改爲http,並且可以在Shibboleth日誌中看到samlp身份驗證請求。

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

我還應該注意到,這實際上是一個站點遷移,現在它全部位於數據中心的窗口中,現在它位於AWS的Linux中。 Load Balancer可能存在一個問題,我們終止了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> 

回答