1

我正在将ITfoxtec.Identity.Saml2.MvcCore 4.0.7 与来自GitHub ITfoxtec的TestWebAppCoreTestIdPCore一起使用。

当我从 Visual Studio 运行此示例时,我没有收到任何错误,并且一切正常。但是,当我将这些示例部署到 Windows server 2019 上的 IIS 10 时,我在测试时遇到错误SecurePage,请参阅下面的错误。

看起来ITfoxtec.Identity.Saml2.Saml2RedirectBinding.Read方法在示例程序中接收POST请求而不是GET

你能帮我解决这个例外吗?

处理请求时发生未处理的异常。

InvalidSaml2BindingException:不是 HTTP GET 方法。Saml2RedirectBinding.cs 中的 ITfoxtec.Identity.Saml2.Saml2RedirectBinding.Read(HttpRequest request, Saml2Request saml2RequestResponse, string messageName, bool validateXmlSignature),第 151 行

堆栈查询 Cookie 标头路由

InvalidSaml2BindingException:不是 HTTP GET 方法。Saml2RedirectBinding.cs 中的 ITfoxtec.Identity.Saml2.Saml2RedirectBinding.Read(HttpRequest request, Saml2Request saml2RequestResponse, string messageName, bool validateXmlSignature)

throw new InvalidSaml2BindingException("不是 HTTP GET 方法。"); ITfoxtec.Identity.Saml2.Saml2Binding.ReadSamlRequest(HttpRequest request, Saml2Request saml2Request) 在 Saml2Binding.cs { TestIdPCore.Controllers.AuthController.ReadRelyingPartyFromLoginRequest(Saml2Binding binding) 在 AuthController.cs 返回 binding.ReadSamlRequest(Request.ToGenericHttpRequest(), new Saml2AuthnRequest( config))?.Issuer; AuthController.cs 中的 TestIdPCore.Controllers.AuthController.Login() var dependingParty = ValidateRelyingParty(ReadRelyingPartyFromLoginRequest(requestBinding)); lambda_method(闭包,对象,对象[])Microsoft.Extensions.Internal.ObjectMethodExecutor.Execute(对象目标,对象[]参数)Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor+SyncActionResultExecutor.Execute(IActionResultTypeMapper映射器,

亲切的问候

4

1 回答 1

0

在我害怕之前我还没有看到这个错误。看起来 SAML 2.0 Authn 请求是作为 POST 而不是 GET 发送的。ITfoxtec Identity SAML的示例默认处理带有 Saml2RedirectBinding 的 SAML 2.0 Authn 请求。您的案例中的 TestWebAppCore.AuthController 登录方法是否使用 Saml2RedirectBinding?

于 2020-09-04T11:52:22.493 回答