asp.net - 如何在 SSRS 2016 中添加自定义身份验证 - 使用 ADFS 和 OWIN
问题描述
我正在努力在 SSRS 2016 之上添加自定义身份验证。有一篇非常好的文章可以做同样的事情
自定义 SecuritySample 2016 - https://github.com/Microsoft/Reporting-Services/tree/master/CustomSecuritySample2016
Microsoft 提供的添加自定义身份验证的步骤基本上是添加表单身份验证,其中将用户名/密码作为 logon.aspx 上的输入。我这样做了,它按预期工作。但我的要求是使用 ADFS(Active Directory 联合服务)对用户进行身份验证。幸运的是,dotnetcurry.com/windows-azure/1166/aspnet-mvc-multiple-adfs-owin-katana 上还有另一篇好文章
感谢上面的文章,我能够在示例 MVC Web 表单应用程序中使用 ADFS 和 OWIN 进行身份验证。
但问题是,当我尝试将上述示例登录添加到 Microsoft 提供的自定义安全示例中时(上面提供的链接)。我遇到了一个例外
引发了“System.Web.HttpUnhandledException”类型的异常。
在上下文中找不到 owin.Environment 项。
所以这就是我正在做的事情。
我在 GitHub 上提供的https://github.com/Microsoft/Reporting-Services/tree/master/CustomSecuritySample2016解决方案中添加了 Startup.cs 文件。然后还在 App_Start 文件夹下添加了 Startup.Auth.cs 文件。修改 web.config 文件以添加以下设置。
<add key="owin:AppStartup" value="Microsoft.Samples.ReportingServices.CustomSecurity.Startup, Microsoft.Samples.ReportingServices.CustomSecurity" />
<add key="owin:AutomaticAppStartup" value="true" />
- 然后在 Logon.aspx 的 Page_Load 事件上,我只是试图通过扩展 HttpContext 来访问 GetOwinContext 方法。
私人无效页面加载(对象发送者,System.EventArgs e)
{var ct = HttpContext.Current.GetOwinContext();
}
- 其余更改与 GitHub 上的自定义安全示例 2016 代码中提到的完全相同(上面的链接)。
我已经用谷歌搜索了这个例外,我已经根据正确的答案添加了这个设置,但我的仍然给出这个例外。
<add key="owin:AppStartup" value="Microsoft.Samples.ReportingServices.CustomSecurity.Startup, Microsoft.Samples.ReportingServices.CustomSecurity" />
<add key="owin:AutomaticAppStartup" value="true" />
是因为 SSRS 不允许加载任何未在 RSReportServer.config 中添加的 DLL?
解决方案
推荐阅读
- python - 集合如何在python内部避免重复?
- flutter - 覆盖自定义颤振小部件
- html - CSS Safari 14 出现问题,当包含在弹性框内的网格中时,子元素会爆炸
- javascript - 删除深层嵌套一维数组中的所有嵌套子节点
- reactjs - 如何检查点击事件是否发生在特定元素内部或外部
- asp.net-core - MVC Net Core 3.1:创建和下载 PDF 文件的工具
- node.js - 如何在 nodejs 14.15 中运行 WebAssembly
- java - GSON; 如何处理END_DOCUMENT?
- c# - 如何在引导警报 -bootstrap MVC 中插入换行符
- reactjs - 为什么 ReactDOMServer.renderToString 不返回原始 HTML