How to share data between SSRS Security and Data Processing extension?

Posted by user2904681 on Stack Overflow See other posts from Stack Overflow or by user2904681
Published on 2013-10-21T21:51:12Z Indexed on 2013/10/21 21:53 UTC
Read the original article Hit count: 357

Filed under:

I've spent a lot of time trying to solve the issue pointed in title and have no found a solution yet.

I use MS SSRS 2012 with custom Security (based on Form Authentication and ClaimsPrincipal) and Data Processing extensions. In Data extension level I need to apply filter programmatically based on one of the claim which I have access in Security extension level only. Here is the problem: I do know how to pass the claim from Security to Data Processing extension code...

What I've tried:

IAuthenticationExtension.LogonUser(string userName, string password, string authority)  
{  
...
ClaimsPrincipal claimsPrincipal = CreateClaimsPrincipal(...);  
Thread.CurrentPrincipal = claimsPrincipal;  
HttpContext.Current.User = claimsPrincipal; 
...  
};

But it doesn't work. It seems SSRS overrides it within either GenericPrincipal or FormsIdentity internally. The possible workaround I'm thinking about (but haven't checked it yet):
1. Create HttpModule which will create HttpContext with all required information (minus: will be invoke getting claims each time - huge operation)
2. Write to custom SQL table to store logged users information which is required for Data extension and then read it
3. try somehow to append to cookies due to LogOn and then read each time on IAuthenticationExtension.GetUserInfo and fill HttpContext

None of them seems to be a good solution.

I would be grateful for any help/advise/comments.

© Stack Overflow or respective owner

Related posts about reporting-services