Forum Discussion

fabio78's avatar
fabio78
Helper I
7 months ago
Solved

Power BI Report Server with custom authentication error Power Bi Desktop

Hi, in a previous post I asked for help configuring PowerBI Report Server with custom authentication and I solved it, so the portal now asks me for username and password via a Logon page, I can access and publish reports with Report Builder. Now my problem is that with Power BI Desktop I can't create the report, but when I publish it, I insert the server URL "http://localhost/reports" (for now I do everything on a server), it gives me the error "An unexpected error occurred" and in the RSPortal log I find this message.

2026-01-15 13:08:44.9152|INFO|1|Catalog max connection pool size: 100
2026-01-15 13:08:50.0377|INFO|1|crypto|Initializing crypto as user: NT SERVICE\PowerBIReportServer
2026-01-15 13:08:50.0677|INFO|1|crypto|Exporting public key
2026-01-15 13:08:50.1922|INFO|1|crypto|Importing existing encryption key
2026-01-15 13:13:25.0209|INFO|8|Received request GET /api/v2.0/ServiceState| RequestID = s_ac7daead-9d37-46ff-a359-47e691c2a8fc
2026-01-15 13:13:25.1845|INFO|8|Sending response. Response code 401, Elapsed time 0:00:00,170559| RequestID = s_ac7daead-9d37-46ff-a359-47e691c2a8fc

in my rsreportserver.config I configured like this
<Authentication>
<AuthenticationTypes>
<Custom />
</AuthenticationTypes>
<RSWindowsExtendedProtectionLevel>Off</RSWindowsExtendedProtectionLevel>
<RSWindowsExtendedProtectionScenario>Any</RSWindowsExtendedProtectionScenario>
<EnableAuthPersistence>true</EnableAuthPersistence>
</Authentication>
<UI>
<ReportServerUrl>http://WIN-3H7LJSG5HQP/ReportServer</ReportServerUrl>
<PageCountMode>Estimate</PageCountMode>
<CustomAuthenticationUI>
<loginUrl>/Logon.aspx</loginUrl>
<UseSSL>False</UseSSL> <PassThroughCookies>
<PassThroughCookie>MyCookieAuth</PassThroughCookie>
</PassThroughCookies>
</CustomAuthenticationUI>
</UI>
<MachineKey ValidationKey="66C93570F79A178D0B513936082F992E5B5B3E69F9444458D43B5C919 31665C58A55B2E1D94C374D8C47F664F98E84378A69E8F3895786C5E351ED503597D5B6"
DecryptionKey="8A649988D4D47D974776D2545D91C0C46B1A8325852B2366"
Validation="SHA1"
Decryption="AES" />

<Authentication>
<Extension Name="Forms" Type="Microsoft.Samples.ReportingServices.CustomSecurity.AuthenticationExtension, Microsoft.Samples.ReportingServices.CustomSecurity" />
</Authentication>

<Security>
<Extension Name="Forms" Type="Microsoft.Samples.ReportingServices.CustomSecurity.Authorization, Microsoft.Samples.ReportingServices.CustomSecurity">
<Configuration>
<AdminConfiguration>
<UserName>admin</UserName>
</AdminConfiguration>
</Configuration>
</Extension>
</Security>

in my web.config
<authentication mode="Forms">
<!--<forms loginUrl="Logon.aspx" name=".ASPXAUTH" timeout="60" cookieless="UseCookies" />-->
<forms loginUrl="Logon.aspx" name="MyCookieAuth" timeout="60" cookieless="UseCookies" path="/" />
</authentication>

Did I miss something? thanks for the help.

  • Hi fabio78,

     

    You’ve used the correct and reliable approach for integrating Power BI Report Server with Custom Authentication and SSAS. By adding CUSTOMDATA={{USERID}} to the PBIRS connection string and referencing it in an SSAS role, you successfully recreate the user context that PBIRS doesn’t provide in Forms mode. Your setup works as intended: the Custom DLL sets the user identity, PBIRS forwards it via CUSTOMDATA, and SSAS applies Row-Level Security through DAX. This method is supported for per-user filtering when EffectiveUserName isn’t available.

    Your architecture is solid: PBIRS operates in Custom Authentication mode, the report sends the custom identity in the connection string, and SSAS handles security in the role. This ensures that all security is managed within the semantic layer, not the report. The results you’re seeing, admins having full access and other users being filtered are expected.

    To expand this to groups, modify your DLL to capture user groups and pass a normalized value into CUSTOMDATA, such as a group key or list. Then, add a group-to-business key mapping table in your Tabular model and adjust your role DAX to filter using CUSTOMDATA(). This approach keeps authorization logic in SSAS, maintains your custom identity throughout, and avoids unsupported changes in PBIRS.

     

    Thank you.

19 Replies