how to pass the current user with reportviewer control

M

Marc

Dear all

I have a asp.net site using the reportviewer control in remote mode. I can
display a report with custom credentials by implementing the
Microsoft.Reporting.WebForms.IReportServerCredentials interface. But there is
only the possibility to impersonate or to read the user from web.config. What
I need is that I can pass the remote report server the current windows user
that is running the asp.net application (this app runs in a intranet context).

passing no credentials does not seem to be an option because it looks as it
takes the WindowsIdentity.GetCurrent() user, this is the user that the
application pool has as identity.

Any ideas?

Thanks in advance,

Marc
 
A

Allen Chen [MSFT]

Hi Marc,

My name is Allen Chen. It's my pleasure to work with you on this issue.

My understanding to your question is like this:

" You have two servers. Server A is a Web Server, Server B runs Reporting
Service.

" You've assigned roles to a report. Say domain/UserA can browse the report
while domain/UserB cannot.

" domain/UserA and domain/UserB can both access the web page. In the web
page, you're using a ReportViewer control to show the report.

" Since domain/UserB has no permission to browse the report you don't want
to let him view the report. As to domain/UserA, he can view the report
normally.

If my understanding is correct, you can try following steps to do so:

1. Enable Basic Authentication for this web site in IIS and disable other
authentication.

2. Add following setting in web.config:
<system.web>
<identity impersonate="true"/>

...
</system.web>

Explanation:

Actually this is a double hop issue. The user viewing the page needs to
provide his credential. If the web site is using Windows Authentication
only the credential is passed to Server A. In that case, impersonation
cannot delegate the user. If the web site is using Basic Authentication the
password will be passed to server as well. Then Server A can work as a
delegation to impersonate the user to communicate with Server B.

Below are some articles related to this.

http://blogs.msdn.com/nunos/archive/2004/03/12/88468.aspx

http://drowningintechnicaldebt.com/blogs/shawnweisfeld/archive/2006/12/06/Th
e-_1C20_Double-Hop_1D20_-Issue.aspx

http://weblogs.asp.net/avnerk/archive/2004/09/22/232967.aspx

Please let me know if it works. If I misunderstood you please correct me
and clarify your requirement.

Regards,
Allen Chen
Microsoft Online Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
M

Marc

Dear Allen,

yes your understanding is correct. Thanks a lot for your help. This solved
the issue.

Best regards,

Marc
 
A

Allen Chen [MSFT]

You're welcome Marc.

Thank you for using our Newsgroup Support Service!

Regards,
Allen Chen
Microsoft Online Community Support



=================================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).
=================================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top