Monday, February 13, 2012

401 Unauthorized When Access Application Remotely

Hello,
I have developed a web application which has a ReportViewer control
embedded in the page and connects to a remote Reporting Services
server. Everything works fine locally in my development environment.
However, when I deploy to the test server, the ReportViewer control
throws a Report Error: 401: Unauthorized exception. I am using
Windows Authentication and Impersonation (the application is on the
local intranet). If I log onto the web server locally and try to
access the web site through localhost, everything works fine. I have
found several articles on implementing the IReportServerCredentials
interface to set the permissions via code, but have not seen anything
on using Windows authentication and impersonation.
Any suggestions would be appreciated...
Thanks!
David.You are most likely experiencing what is called the "double hop" issue.
This happens all the time, thanks to the security set up by default on
your servers. When you log in to your server through the web it will
trust you, but strip your credentials from you. You will be an
anonymous user. Then when you try to request the data in a report from
another data source, it will pass your anonymous credentials to the
other server, and therefore you being denied access is a good thing.
The reason it works when you log in directly to the sever is because it
retains your credentials then. The solution to this is delegation,
which can be set up by the domain controller. This should be enough to
get you started I hope!
Lance M.
Cyke wrote:
> Hello,
> I have developed a web application which has a ReportViewer control
> embedded in the page and connects to a remote Reporting Services
> server. Everything works fine locally in my development environment.
> However, when I deploy to the test server, the ReportViewer control
> throws a Report Error: 401: Unauthorized exception. I am using
> Windows Authentication and Impersonation (the application is on the
> local intranet). If I log onto the web server locally and try to
> access the web site through localhost, everything works fine. I have
> found several articles on implementing the IReportServerCredentials
> interface to set the permissions via code, but have not seen anything
> on using Windows authentication and impersonation.
> Any suggestions would be appreciated...
> Thanks!
> David.

No comments:

Post a Comment