如何为ITFoxtec.Identity.Saml2的TestIdpCore添加登录界面?
扩展TestIdPCore添加用户名密码登录界面的正确方法咨询
背景
基于ITFoxtec.Identity.Saml2的TestIdPCore项目开发自定义身份提供商(IdP),已完成适配OneLogin wordpress-saml插件的签名/加密断言相关问题修复,包括:
- wordpress-saml插件令牌解密代码破坏断言签名的Bug(Issue #136)
- TestIdPCore在.NET Core 6环境下加载私钥的问题(Pull Request #112)
- TestIdPCore未按依赖方配置令牌加密证书的问题(Pull Request #113)
原示例通过硬编码声明,在AuthController.Login()方法中直接返回结果。我尝试添加用户名/密码登录视图及对应的UserAuthenticationRequest模型,修改原有GET请求的Login方法返回View("Authentication"),并新增带有[HttpPost("Login")]和[ValidateAntiForgeryToken]特性的async Task<IActionResult> Login(UserAuthenticationRequest request)方法,但迁移原Login方法代码时遇到以下问题:
遇到的错误
使用Saml2RedirectBinding时抛出异常:
InvalidSaml2BindingException: Not HTTP GET Method.
ITfoxtec.Identity.Saml2.Saml2RedirectBinding.Read(HttpRequest request, Saml2Request saml2RequestResponse, string messageName, bool validate, bool detectReplayedTokens) ITfoxtec.Identity.Saml2.Saml2Binding<T>.ReadSamlRequest(HttpRequest request, Saml2Request saml2Request) MyExampleIdP.Controllers.AuthController.ReadRelyingPartyFromLoginRequest<T>(Saml2Binding<T> binding) in AuthController.cs
改用Saml2PostBinding时,系统要求登录表单必须提交SAMLRequest和RelayState参数,现有相关提问未给出可行解决方案,特此咨询:扩展TestIdPCore以添加简单用户名/密码登录界面的正确方法是什么?
内容的提问来源于stack exchange,提问作者lwg-ga
相关产品推荐
相关产品推荐

