ASP.NET使用Windows集成安全性连接到SSRS报告吗?

时间:2019-06-19 16:05:45

标签: asp.net sql-server reporting-services

当前,我们的ASP.NET应用程序使用用户名和pwd连接到SSRS报告。

我该如何使用Windows集成安全性进行连接?

这是将报表服务器配置为使用Windows集成安全性: https://docs.microsoft.com/en-us/sql/reporting-services/security/configure-windows-authentication-on-the-report-server?view=sql-server-2017

但是,此后我们需要在应用程序中进行哪些更改?

以下是我们当前的代码:

ReportViewer1.ServerReport.ReportServerCredentials = new ReportServerNetworkCredentials();
ReportViewer1.ServerReport.ReportServerUrl = new Uri(System.Configuration.ConfigurationManager.AppSettings["myReportServerURL"].ToString());
ReportViewer1.ServerReport.ReportPath = strReportToLoad;
ReportViewer1.ServerReport.SetParameters(paramList);
ReportViewer1.ServerReport.Refresh();
ReportViewer1.Visible = true;

public sealed class ReportServerNetworkCredentials : IReportServerCredentials
:
    public System.Net.ICredentials NetworkCredentials
    {
        get
        {
            return new System.Net.NetworkCredential("myUserName", "myPWD", "myDomainName");
        }
}

谢谢。

0 个答案:

没有答案