Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSRS Showing Authentication Error

I am running a Reports Server (SSRS) and I am calling the reports from within my ASP application. Whenever I try to load a report through the site itself it shows me a HTTP 401 Error, both locally and accessing through the domain. If I open the reports in the ReportServer itself I can open them up fine, the problem is loading through the web page. I tried changing the credentials in the data source itself but everything was fine, switched the SQL User credential and Windows Authentication and nothing helped. Any help would be appreciated as I am at a loss about what to do.

This is the local server error:

[WebException: The request failed with HTTP status 401: Unauthorized.]
  Microsoft.Reporting.WebForms.Internal.Soap.ReportingServices2005.Execution.RSExecutionConnection.GetSecureMethods() +232
Microsoft.Reporting.WebForms.Internal.Soap.ReportingServices2005.Execution.RSExecutionConnection.IsSecureMethod(String methodname) +60
 Microsoft.Reporting.WebForms.Internal.Soap.ReportingServices2005.Execution.RSExecutionConnection.SetConnectionSSLForMethod(String methodname) +16
     Microsoft.Reporting.WebForms.Internal.Soap.ReportingServices2005.Execution.ProxyMethodInvocation.Execute(RSExecutionConnection connection, ProxyMethod`1 initialMethod, ProxyMethod`1  retryMethod) +831
Microsoft.Reporting.WebForms.SoapReportExecutionService.LoadReport(String report, String historyId) +34
Microsoft.Reporting.WebForms.ServerReport.EnsureExecutionSession() +175
Microsoft.Reporting.WebForms.ServerReport.SetParameters(IEnumerable`1 parameters) +162
 System.Web.UI.Control.LoadRecursive() +71
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3178

ASPX Codebehind:

 ReportViewer1.ServerReport.ReportServerUrl = new System.Uri("serveradress");
            ReportViewer1.ServerReport.ReportPath = "/TrialBalance";
            Microsoft.Reporting.WebForms.ReportParameter[] Param = new Microsoft.Reporting.WebForms.ReportParameter[1];
            Param[0] = new Microsoft.Reporting.WebForms.ReportParameter("ID", Convert.ToString(Session["BranchID"]));

            ReportViewer1.ShowParameterPrompts = false;
            ReportViewer1.ServerReport.SetParameters(Param);
            ReportViewer1.ServerReport.Refresh();

Attempts! 1) Gave AppPool LocalSystem permissions

2) i can access the Reportserver using domain.com/ReportServer or localhost/ReportServer, problem only occurs within the ASP app.

3) Verified SSRS Service Account permissions.

4) DataSource connects without issue.

5) The reports were working without issue a week ago, I migrated a server image to another more powerful server and I believe this is were it got broken but I don't see how as the image is the SAME. Nothing changed.

6) I can call the ReportServer (Report Loads and all) in my local development computer, which aims at the remote server. If I access the same ASPX in the website it gives me the HTTP 401 error

7) Changed in programing to aim at localhost directly... this was the error:

An error has occurred during report processing. (rsProcessingAborted)
    Cannot create a connection to data source 'DataSource1'. (rsErrorOpeningConnection)
        Cannot open database "CoopBranches" requested by the login. The login failed. Login failed for user 'NT AUTHORITY\SYSTEM'.

Which is weird because I am testing the data source and it is connecting without any issue.

like image 446
Lord Relix Avatar asked Aug 27 '26 16:08

Lord Relix


1 Answers

I came across with the same issue several days ago and here are some suggestions based on what I did on mine.

  1. On you app pool try to indicate/impersonate a domain user then give that report permissions on the server.
  2. This one gives a big difference. Try to see what ReportViewer1 is resolving to, what I notice is that if your application goes to

http://{YourReportServerURL}/ReportServer/Pages/ReportViewer.aspx?/{YourReportName}&{Param1}={ParamValue}

Then you will have a multi hop authentication issue beacuse that URL Redirects to another URL that eventually resolves to, loosing the authenticated user in the process when not using Kerberos

http://{YourReportServerURL}/ReportServer?/{YourReportFolder}/{YourReportName}&{Param1}={ParamValue}

If thats the case try to generate the URL manually like such

http://{YourReportServerURL}/ReportServer?/{YourReportFolder}/{YourReportName}&{Param1}={ParamValue}

like image 148
Raymund Avatar answered Aug 30 '26 05:08

Raymund