升级Sustainsys.Saml2至1.0.3后request.ToHttpRequestData()参数问题
解决Sustainsys.Saml2 1.0.3中Run方法的modulePath参数问题
- 参数含义:
modulePath是SAML模块的基础路径,对应你项目中SAML端点的路径前缀(比如ACS端点为/Saml2/Acs时,modulePath就是/Saml2)。 - 代码修改示例:
原报错代码:
修改后代码:var commandResult = CommandFactory.GetCommand(CommandFactory.AcsCommandName).Run(request.ToHttpRequestData(), Saml2Controller.Options);// 替换为你实际的SAML模块路径前缀,要和配置中的路径一致 string modulePath = "/Saml2"; var commandResult = CommandFactory.GetCommand(CommandFactory.AcsCommandName).Run(request.ToHttpRequestData(), Saml2Controller.Options, modulePath); - 路径匹配要求:如果你的Startup配置中设置了SAML的
ModulePath,比如:
此时传入的services.AddSaml2(options => { options.ModulePath = "/Saml2"; // 其他配置项 });modulePath必须和配置中的options.ModulePath完全一致。 - 特殊场景处理:若SAML端点直接使用根路径(比如
/Acs),则modulePath传空字符串""或者"/"即可。
内容的提问来源于stack exchange,提问作者manaslu
相关产品推荐
相关产品推荐

