我有一個上有一個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