Search code examples
visual-studio-2008iis-7ssrs-2008user-permissionsreportviewer2008

Report viewer gets a 401 Unauthorized


In a nutshell, the problem is that I get a 401 Unauthorized error with the following stacktrace when I try to view the report embedded in a report viewer.

   at Microsoft.SqlServer.ReportingServices2005.Execution.RSExecutionConnection.GetSecureMethods()
   at Microsoft.SqlServer.ReportingServices2005.Execution.RSExecutionConnection.IsSecureMethod(String methodname)
   at Microsoft.SqlServer.ReportingServices2005.Execution.RSExecutionConnection.LoadReport(String Report, String HistoryID)
   at Microsoft.Reporting.WebForms.ServerReport.GetExecutionInfo()
   at Microsoft.Reporting.WebForms.ServerReport.SetParameters(IEnumerable`1 parameters)
   at ReportingObject.RenderReport(ReportViewer reportViewer, ReportParameter[] param) in C:\Projects\RBDCReportMapIntelligence\RBDCReportMapIntelligence\ReportingObject.cs:line 41
   at Report.btnViewReport_Click(Object sender, EventArgs e) in c:\Projects\RBDCReportMapIntelligence\RBDCReportMapIntelligence\Report.aspx.cs:line 126
   at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
   at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
   at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
   at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
   at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Here are more details:

  1. My machine (running Windows Vista) has both the IIS and the reporting services running.
  2. I am the local admin on my machine but not the system admin.
  3. I have configured reporting services to give myself access according to this post (seems a pretty common solution around). But even after doing this, I cannot see report manager without running IE as admin.
  4. The IIS only has anonyms authentication enabled with DefaultAppPool for all sites and I'm not really sure what should and should not be enabled. The DefaultAppPool is Integrated Managed Pipeline Mode with NetworkService set as the Identity.
  5. I'm not sure if there is some setting on VS that I need to change.
  6. I have a class implementing IReportServerCredentials interface (as per to a lot of examples on the net) for connecting to the report server

I have tried to look on the web and on stackoverflow as well and I have tried a lot of things from those solutions but nothing seems to help.

Would be great if someone could help. Please let me know if I need to add any more detail to the question.


Solution

  • I got this working by:

    1. Switching off UAC, which now lets me look at the report manager without running IE in as an admin
    2. Created a new app pool running under network service and running the application under that app pool
    3. Running Reporting Services under the network service account.

    Hope it helps someone else.