I'm getting an 401 unauthorized error when using the ReportViewer on my test server. On my local environment (with the configurations pointed to the test server), I'm able to connect without a problem. I've tried looking the following solutions but with no luck. One two three
The authentication mode I am using is Windows and while my windows credentials I have access to the report server, I'm still unable to connect.
In my web.config
<system.web>
<customErrors mode="Off" />
<authentication mode="Windows" />
<authorization>
<deny users="?" />
</authorization>
...
My controller
private ReportViewer _reportViewer;
public ReportController()
{
_reportViewer = new ReportViewer();
_reportViewer.ProcessingMode = ProcessingMode.Remote;
_reportViewer.SizeToReportContent = false;
_reportViewer.Width = Unit.Percentage(100);
_reportViewer.Height = Unit.Pixel(893);
string RptServerURL = ConfigurationManager.AppSettings["MyReportServerUrl"];
_reportViewer.ServerReport.ReportServerUrl = new Uri(RptServerURL);
}
So that I may pinpoint the error, how and where can I see the user the my code is trying to authenticate with? I checked the exception but all the information I get is unauthorized, without telling my the user that is being used.