Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
malikirfan28
Helper II
Helper II

Report Server Custom Authentication

Hello Everyone,

I am newbie in Power BI Report Server and tried to configure it for custom/form authentication as explained in this article

https://github.com/Microsoft/Reporting-Services/tree/master/CustomSecuritySample

 

I performed all steps as mentioned in article and when I browse ReportServer it successfully show me Login page. However whenever I click eiher "Register User" button OR "Login" button, I get following exception

An error occurred while attempting to add the account. Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

I notice that in article's Step 3 it is mentioned to add <CodeGroup> in RSSrvPolicy.config file for FullTrust permission. However the step description is very confusing to me

Add the following <CodeGroup> element after the existing code group in the security policy file that has a URL membership of $CodeGen as indicated below and then add an entry as follows to RSSrvPolicy.config. Make sure to change the below path according to your ReportServer installation directory:

<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 Power BI Report Server\PBIRS\ReportServer\bin\Microsoft.Samples.ReportingServices.CustomSecurity.dll"/>
</CodeGroup>

I am not sure I have to add this CodeGroup as New code group below of existing Member Url="$CodeGen$/*" codegroup OR I will have to replace existing $CodeGen Member URL code group with this one. So I tried both. When I add this article CodeGroup as New below of existing then ReportServer browse successful and show login page, but Permission exception occur as shown above.

 

When I replace existing $CodeGen Member URL code group with this article code group then ReportServer does not browse and give HTTP 500 error.

 

So please expert guidance on this. Thanks

2 ACCEPTED SOLUTIONS

Thank you @v-qiuyu-msft for comments. It seems I had wrong URL in CodeGroup membership. When I changed URL from

C:\Program Files\Microsoft Power BI Report Server\PBIRS\PowerBI\Microsoft.Samples.ReportingServices.CustomSecurity.dll

to C:\Program Files\Microsoft Power BI Report Server\PBIRS\ReportServer\bin\Microsoft.Samples.ReportingServices.CustomSecurity.dll, it seems the permission problem has resolved and I can register new user.

 

However when login goes successfull and navigate to ReportServer Web Portal URL, it shows HTTP 500 Internal Server ERROR. Is there any way to investigate and find-out root cause of it?

 

Thanks once again,

M. Irfan

 

View solution in original post

Thanks @pbx This link help me to find out the exact problem. So for rest of the community here is the reason of HTTP 500 error

 

When we added "machineKey" in <RSPATH>\ReportServer\web.config path, everytime when pbix service restarted it remove this key.  The step mentined here need to be updated @v-qiuyu-msft. Best solution is to add machinekey in "machine.config" file inside <system.web> and then restart machine

32-bit

%windir%\Microsoft.NET\Framework\[version]\config\machine.config

64-bit

%windir%\Microsoft.NET\Framework64\[version]\config\machine.config 

 Note: This entry may create conflicts/problem for other application running on same machine so be careful.

 

Hope this will help. Thank you.

 

View solution in original post

18 REPLIES 18

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.