Using Forms Authentication with Reporting Services 2008 worked fine based on the sample from code project:
But after I installed a second instance of Reporting Services 2008 on the same machine, the security extension did no longer work as expected. The problem was that the newly installed instance was using SSL, the first one did not. When I tried to login to the Reporting Services 2008 first instance, I received “The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel”. In the log files there was this error: “Remote certificate error RemoteCertificateChainErrors encountered for url”. This is how I found out that the security extension did not use the proper report server URL!
After debugging, I found the following problem and solution:
The security extension uses WMI in the following method to determine the ReportServerUrl:
internal static string GetReportServerUrl(string machineName, string instanceName)
When multiple instances are running, we have 2 ManagementObjects, even if we use the correct WMI path! The following picture shows that there are 2 MSReportsServer_Instance instances. So
I changed the code to this:
foreach (ManagementObject instance in instances)
// we are interested only for a specific instance
var instanceNameProperty = instance.GetPropertyValue("InstanceName");
if (instanceNameProperty != null && String.Compare(instanceNameProperty.ToString(), instanceName, true) != 0)
This way I correctly retrieve the reports’ server url of the specified instance.
For performance reasons, I think it would be much easier to hard code the URLs value into the web.config and not query the value through WMI. The disadvantage would be that if you change the Reporting Services 2008 configuration, you need to manually edit the web.config of the ReportServer too.