Our client has SQL Server Reporting Service (SSRS) running on-premise in their corporate network. Right now the users access reports by using the standard/native web portal of a report server only from computers connected to their domain controlled corporate network where the SSRS server resides. We are currently building a custom web application that acts as a wrapper for executing SSRS reports. It is a standard ASP.NET Web Forms application and we use the ReportViewer control to display reports. The ASP.NET application is hosted in Azure App Service where we use the built-in authentication and authorization in Azure (sometimes referred to as "Easy Auth"). The SSO authentication uses the Microsoft (ActiveDirectory) identity provider. The problem is that the web application needs to pass network credentials when consuming the SSRS service and executing reports in a ReportViewer. Here is our code which works fine when passing hard-coded credentials to access SSRS:
When using the SSRS web service to pull the list of reports:
ReportingService2010 rs = new ReportingService2010(); rs.Credentials = new NetworkCredential("[USERNAME]", "[PASSWORD]", "[DOMAIN]");
When executing a report in a ReportViewer:
ReportViewer1.ServerReport.ReportServerCredentials = new CustomSSRSCredentials("[USERNAME]", "[PASSWORD]", "[DOMAIN]");
In my last code snippet the CustomSSRSCredentials is a custom class implementing the IReportServerCredentials interface which seems to be a standard practice to pass network credentials through the ReportViewer.
The problem with that approach is that I need to pass particular network credentials – both username and password. In that scenario I need to have a pre-defined service account which will have access to all reports in SSRS, for example.
What I am asking for is if there is any way to call SSRS service/reports on behalf of the currently authenticated user in Azure? The goal to use the authenticated current user when calling SSRS is to allow each user to run only the reports that he or she has been granted to access in the SSRS native portal. Is this possible?