I'm working on implementing a custom security extension for SQL Server Reporting Services (SSRS) 2019 Developer Edition. I'm following the official sample provided by Microsoft on GitHub (CustomSecuritySample) and have configured everything as per the documentation. However, when I deploy it, I get the following error in the SSRS log:
library!ReportServer_0-1!4314!05/11/2025-18:56:07:: e ERROR: Throwing Microsoft.ReportingServices.Diagnostics.Utilities.ServerConfigurationErrorException: Could not load Authentication extension, Microsoft.ReportingServices.Diagnostics.Utilities.ServerConfigurationErrorException: The report server has encountered a configuration error. ;
What I've done:
- Created a custom security extension (implements IAuthenticationExtension2, IExtension and IAuthorizationExtension). This is the exact copy of provided sample, except SQL validation part. Instead of going to DB, I am verifying it manually like password === "Password123" (for simplicity)
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]
public bool LogonUser(string userName, string password, string authority)
{
return password == "Password123";
}
Targeted the project to .NET Framework 4.7.2 in Visual Studio
Deployed the compiled DLL Microsoft.Samples.ReportingServices.CustomSecurity.dll to: C:\Program Files\Microsoft SQL Server Reporting Services\SSRS\ReportServer\bin
Updated RSReportServer.config:
<Authentication>
<AuthenticationTypes>
<Custom/>
</AuthenticationTypes>
<EnableAuthPersistence>true</EnableAuthPersistence>
</Authentication>
<Security>
<Extension Name="Forms" Type="Microsoft.Samples.ReportingServices.CustomSecurity.Authorization, Microsoft.Samples.ReportingServices.CustomSecurity">
<Configuration>
<AdminConfiguration>
<UserName>username</UserName>
<UseSSL>False</UseSSL>
</AdminConfiguration>
</Configuration>
</Extension>
</Security>
<Extensions>
<Authentication>
<Extension Name="Forms" Type="Microsoft.Samples.ReportingServices.CustomSecurity.AuthenticationExtension, Microsoft.Samples.ReportingServices.CustomSecurity" />
</Authentication>
</Extensions>
Added the necessary to both RSReportServer.config and web.config
Added full trust code group in rssrvpolicy.config:
<CodeGroup class="UnionCodeGroup" version="1" Name="SecurityExtensionCodeGroup" Description="Code group for the sample security extension" PermissionSetName="FullTrust">
<IMembershipCondition class="UrlMembershipCondition" version="1" Url="C:\Program Files\Microsoft SQL Server Reporting Services\SSRS\ReportServer\bin\Microsoft.Samples.ReportingServices.CustomSecurity.dll" />
</CodeGroup>
- Restarted the SSRS service after all changes
- Verified no typos in namespaces, type names, or file paths
What I've verified:
The DLL is built with the correct namespace and class name (Microsoft.Samples.ReportingServices.CustomSecurity.Authorization)
The class implements IAuthorizationExtension properly (even tested with a stub implementation)
All referenced assemblies are from .NET Framework, no external NuGet dependencies involved
The DLL is not blocked or partially signed
Event logs and SSRS logs show only the Could not load Authorization extension error — no FileLoadException or BadImageFormatException
What I need help with:
What else could cause SSRS to fail to load the Authorization extension when everything appears correctly configured?
Are there known compatibility issues with .NET 4.8.1 and SSRS custom extensions?
Is there a way to increase logging verbosity or get a stack trace from the SSRS plugin loader?
Any insights or debugging tips would be greatly appreciated! Thank you.