我有一个上有一个ReportViewer控件的ASP.NET应用程序:SSRS,和的ReportViewer ASP.NET拒绝访问
<rsweb:ReportViewer ID="rv" runat="server" ProcessingMode="Remote"
ShowParameterPrompts="False"AsyncRendering="true" >
<ServerReport ReportPath="<My Report>" ReportServerUrl="<Report Server URL>" />
</rsweb:ReportViewer>
报表服务器不同的服务器比我的应用程序服务器上运行,所以我“M传递凭据当我打电话报告:
rv.ServerReport.ReportServerCredentials = New ReportCredentials()
rv.ServerReport.SetParameters(params)
rv.ServerReport.Refresh()
凭证,在这个类:
<Serializable()> _
Public Class ReportCredentials
Implements Microsoft.Reporting.WebForms.IReportServerCredentials
Public Function GetFormsCredentials(ByRef authCookie As System.Net.Cookie, ByRef userName As String, ByRef password As String, ByRef authority As String) As Boolean Implements Microsoft.Reporting.WebForms.IReportServerCredentials.GetFormsCredentials
authCookie = Nothing
userName = Nothing
password = Nothing
authority = Nothing
Return False
End Function
Public ReadOnly Property ImpersonationUser() As System.Security.Principal.WindowsIdentity Implements Microsoft.Reporting.WebForms.IReportServerCredentials.ImpersonationUser
Get
Return Nothing
End Get
End Property
Public ReadOnly Property NetworkCredentials() As System.Net.ICredentials Implements Microsoft.Reporting.WebForms.IReportServerCredentials.NetworkCredentials
Get
Return New NetworkCredential(AppSettings("ReportUser"), Helpers.GetReportPassword(), AppSettings("ReportDomain"))
End Get
End Property
末级
在我的web.config文件中,我得到了impersonate =“true”。
我遇到的问题是,大多数用户收到此错误:如果我在我的帐户下运行的应用程序,然后让他们尝试自己的帐户它的工作原理下
Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
。我可以通过回收应用程序正在运行的App Pool来重现错误。如果我在应用程序服务器上让用户成为本地管理员(就像我一样),那么它将工作,但显然我不想这样做。关于我在做什么错误的任何想法,以及为什么在我运行一次后突然为他们应用程序的原因?
最后,我刚刚关闭模拟,因为我意识到我不需要它。然后,我不必再给machine.config任何额外的权限 – sbaum 2011-04-28 17:58:57
你能告诉你如何在没有冒充的情况下完成它吗?谢谢! – Serhiy 2011-11-04 13:57:22