访问Saml2 Controller时找不到资源

时间:2019-08-05 07:09:15

标签: c# asp.net-mvc sustainsys-saml2

我试图为我们的ASP.net MVC Web应用程序设置SAML2。遵循官方文档(https://saml2.sustainsys.com/en/2.0/)上的指南。但是当我访问控制器时它显示 “找不到资源。” Saml2 Controller操作无效。

http://localhost:63856/Saml2/

我尝试设置一个Web表单应用程序。加载了httpmodule,没有问题。我试图加载httpmodule(显然不应该在MVC应用程序中加载),saml2操作有效,但是由于某种原因它给出了无效的响应。

我在配置部分进行了设置

<section name="system.identityModel" type="System.IdentityModel.Configuration.SystemIdentityModelSection, System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    <section name="system.identityModel.services" type="System.IdentityModel.Services.Configuration.SystemIdentityModelServicesSection, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    <section name="sustainsys.saml2" type="Sustainsys.Saml2.Configuration.SustainsysSaml2Section, Sustainsys.Saml2"/>

已在模块中添加

  <add name="SessionAuthenticationModule" type="System.IdentityModel.Services.SessionAuthenticationModule, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="managedHandler"/>

并添加了主要配置

 <sustainsys.saml2 entityId="https://xxxxxxxxxx.xxxx.xx" returnUrl="https://xxxxxxxxxx.xxxx.xx/Sso/Authenticate" authenticateRequestSigningBehavior="Always">
      <serviceCertificates>

        <add fileName="C:\xxxx.pfx" use="Signing" />

      </serviceCertificates>

      <identityProviders>
        <add entityId="xxxx.xxxxxxx.xxx" signOnUrl="https://xxxxxxxxxx.xxxx.xx"  allowUnsolicitedAuthnResponse="true" binding="HttpRedirect">
          <signingCertificate fileName="C:\tmp\xxxxxxx.crt" />
      </add>
    </identityProviders>
  </sustainsys.saml2>
  <system.identityModel.services>
    <federationConfiguration>
      <cookieHandler requireSsl="false" name="DCMAuth"/>
    </federationConfiguration>
  </system.identityModel.services>

当我访问时  http://localhost:63856/Saml2/

没有HttpModule。它给出了

The resource cannot be found. 

描述:HTTP404。您正在寻找的资源(或其依赖项之一)可能已被删除,名称更改或暂时不可用。请查看以下网址,并确保其拼写正确。

请求的网址:/ Saml2 /

但是当我加载HttpModule时。它给出了无效的响应。

我想念什么吗?在我的主项目中仅引用Sustainsys.web.mvc。

0 个答案:

没有答案