I am using ITfoxtec.Identity.Saml2.MvcCore 4.0.7 with TestWebAppCore and TestIdPCore from GitHub ITfoxtec.
When I run this sample from Visual Studio I am not getting any errors and everything works fine. But when I deploy these samples to IIS 10 on Windows server 2019 then I get an error on testing SecurePage
, see my error here below.
It looks like ITfoxtec.Identity.Saml2.Saml2RedirectBinding.Read
method receives an POST request in the Sample program instead of GET.
Can you help me with this exception?
An unhandled exception occurred while processing the request.
InvalidSaml2BindingException: Not HTTP GET Method. ITfoxtec.Identity.Saml2.Saml2RedirectBinding.Read(HttpRequest request, Saml2Request saml2RequestResponse, string messageName, bool validateXmlSignature) in Saml2RedirectBinding.cs, line 151
Stack Query Cookies Headers Routing
InvalidSaml2BindingException: Not HTTP GET Method. ITfoxtec.Identity.Saml2.Saml2RedirectBinding.Read(HttpRequest request, Saml2Request saml2RequestResponse, string messageName, bool validateXmlSignature) in Saml2RedirectBinding.cs
throw new InvalidSaml2BindingException("Not HTTP GET Method."); ITfoxtec.Identity.Saml2.Saml2Binding.ReadSamlRequest(HttpRequest request, Saml2Request saml2Request) in Saml2Binding.cs { TestIdPCore.Controllers.AuthController.ReadRelyingPartyFromLoginRequest(Saml2Binding binding) in AuthController.cs return binding.ReadSamlRequest(Request.ToGenericHttpRequest(), new Saml2AuthnRequest(config))?.Issuer; TestIdPCore.Controllers.AuthController.Login() in AuthController.cs var relyingParty = ValidateRelyingParty(ReadRelyingPartyFromLoginRequest(requestBinding)); lambda_method(Closure , object , object[] ) Microsoft.Extensions.Internal.ObjectMethodExecutor.Execute(object target, object[] parameters) Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor+SyncActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, object controller, object[] arguments) Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync() Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted) Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync() Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted) Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync() Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync() Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker) Microsoft.AspNetCore.Routing.EndpointMiddleware.g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger) Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
Kind Regards Ed