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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
danielnord
New Member

For others trying to find the solution.

 

I had some problemswith 500 error too. I found out that there are a couple of steps you need to do after you have set the plugin. See my comment in this issue (danielnord): https://github.com/Microsoft/Reporting-Services/issues/49

Hi @danielnord

 

I followed all steps but still I am getting below error. Can you please give me the solution .

 

018-12-14 15:03:14.8087|INFO|1|CONFIG : rsConfigFilePath = [C:\Program Files\Microsoft Power BI Report Server\PBIRS\ReportServer\rsreportserver.config] (env)
2018-12-14 15:03:17.1056|INFO|1|CONFIG : AccessControlAllowOrigin = [] (env)
2018-12-14 15:03:17.1056|INFO|1|CONFIG : AccessControlAllowHeaders = [] (env)
2018-12-14 15:03:17.1056|INFO|1|CONFIG : AccessControlAllowMethods = [GET, PUT, POST, PATCH, DELETE] (env)
2018-12-14 15:03:17.1056|INFO|1|CONFIG : AccessControlExposeHeaders = [] (env)
2018-12-14 15:03:17.1056|INFO|1|CONFIG : AccessControlMaxAge = [600] (env)
2018-12-14 15:03:17.1368|INFO|1|CONFIG : SecureConnectionLevel = [0] (env)
2018-12-14 15:03:19.2618|INFO|1|CONFIG : MaxActiveReqForOneUser = [20] (env)
2018-12-14 15:03:19.2618|INFO|1|CONFIG : MaxActiveReqForAnonymous = [200] (default)
2018-12-14 15:04:41.5054|INFO|5|Received request GET | RequestID = s_69cc7afc-3bd5-4042-be76-7f14cd3a3c0a
2018-12-14 15:04:41.5992|ERROR|5| 10.120.243.36: GET - 0:00:00.0833391
Exception: System.Web.HttpException (0x80004005): Unable to validate data.
at System.Web.Configuration.MachineKeySection.EncryptOrDecryptData(Boolean fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Boolean useValidationSymAlgo, Boolean useLegacyMode, IVType ivType, Boolean signData)
at System.Web.Security.FormsAuthentication.Decrypt(String encryptedTicket)
at Microsoft.BIServer.Owin.Common.Middleware.CustomAuthenticationMiddleware.CreateRequestContextFromCookie(IOwinContext context)
at Microsoft.BIServer.Owin.Common.Middleware.CustomAuthenticationMiddleware.CreatePortalIdentity(IOwinContext context)
at Microsoft.BIServer.Owin.Common.Middleware.CustomAuthenticationMiddleware.Invoke(IOwinContext context)
at Microsoft.Owin.Security.Infrastructure.AuthenticationMiddleware`1.<Invoke>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---

 

Thanks in Advance...

pbx
Helper V
Helper V

Have you seen this? Take note of the very last comment.

https://github.com/Microsoft/Reporting-Services/issues/26

 

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.

 

This worked for me.

Here are the details:

edited C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config

Add machinekey under system.web

I used Visual Studio to edit machine.config. Must start VS as admin.

Restart computer, restart rs service

Thank you so much for this post.  Adding the machine key to the machine.config file worked. 

@malikirfan28:

The proper documentation about custom security extensions can be found here:

https://docs.microsoft.com/en-us/sql/reporting-services/extensions/security-extension/how-to-install...

 

That means for PBIRS the machine key should be placed in \ReportServer\rsReportServer.config. However according to the following link, a bug in PBIRS, at least up to this version 1.1.6514.9163 (Build 14.0.600.434), exists that requires putting they keys in machine.config. Given that there's been two minor relases after that, could you please confrim if the bug still exists in the latest release, Version 1.1.6551.5155 (Build 14.0.600.438)?

 

https://github.com/Microsoft/Reporting-Services/issues/26

annucsb
Frequent Visitor

I installed Power Bi Report Server - Evaluation, Product Version 15.0.2.378 and I still had to update the machine config to get it to work with the custom security example. 

Dear @pbx, Ok I will check new version on fresh mahine and then update here.

However right now when a new registered user login successfully, PBIRS display error:

 

The Builten (Windows) Administrator acccount does not work with custom security so how can I login as Administrator and grant permission to custom user? If I revert back to Windows Authentication then builten Administrator work and I can change Site Setting, but at this time PBIRS does not found any custom user name. When I try to add custom user name in "Add User or Group" field it give error, "such user or group does not exist".

Any idea?

 

 

asheralikhan
New Member

I am Also getting the same issue...

 

 

prazzy88
Helper I
Helper I

We are also facing same issue. Http 500 issue for custom authenticatiom after login page. Its not loading PBReports page

It seems a problem in Product which does not support this feature. Smiley Frustrated

v-qiuyu-msft
Community Support
Community Support

Hi @malikirfan28,

 

I don't have much experience with develop section. Maybe @mgmeyer@riccardomuti@Jon-Heide from PG team have ideas? 

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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

 

Dear @v-qiuyu-msft@mgmeyer@riccardomuti@Jon-Heide

Please need your support to resolve this HTTP 500 Error after successful login on Power  BI Report Server.

 

Thank you in advance

You can review my configuration files using following  links:

rsreportserver.config

rssrvpolicy.config

web.config

 

I have already placed Microsoft.Samples.ReportingServices.CustomSecurity.dll & pdb file in 

C:\Program Files\Microsoft Power BI Report Server\PBIRS\ReportServer\bin

C:\Program Files\Microsoft Power BI Report Server\PBIRS\PowerBI

C:\Program Files\Microsoft Power BI Report Server\PBIRS\Portal

 

Please need your urgent support to resolve this HTTP 500 Internal Server Error.

 

Thank you.

did you get solution? Please let me know if you get solution

 

Thanks in advance

Yes - this is my solution

 

Here are the details:

edited C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config

Add machinekey under system.web

I used Visual Studio to edit machine.config. Must start VS as admin.

Restart computer, restart rs service

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors