all groups > sql server reporting services > november 2006 >
You're in the

sql server reporting services

group:

ASP.Net <-- Report Server http 401 Unauthorized


ASP.Net <-- Report Server http 401 Unauthorized dev648237923
11/8/2006 1:40:27 PM
sql server reporting services:
Setup:
All boxes Windows 2003 SP1 in a Domain
-SQL 2005 on one box,
-IIS6 on another box
-Domain Controlelr on another box

I have an ASP.Net app with a ReportViewer control.
I get reports from the sql server on this same domain.
The IIS server on the sql box (reporting box) is set to not allow anonymous.

In my asp.net app I get I get 401 Unauthorized when trying to load the
reportviewer.

I wanted to see what account asp.net was using to connect so I did:
Response.Write(System.Security.Principal.WindowsIdentity.GetCurrent().Name);
The result is: NT AUTHORITY\NETWORK SERVICE

I give account this Browse privs in SSRS (and write prives to asp.net temp
files)
Still 401 unauthorized.

I made an account called testuser and then in my web.config I do:
<identity impersonate="true" username="domain1\testuser" password="password"
/>
I give account this Browse privs in SSRS (and write prives to asp.net temp
files)
That works!

What I do not understand is why do I need the addition to web.config? On
another domain I have a similar situation and it works fine using NT
AUTHORITY\NETWORK SERVICE without resorting to making this testuser and
impersonating?

Thank you!

RE: ASP.Net <-- Report Server http 401 Unauthorized stcheng NO[at]SPAM online.microsoft.com
11/9/2006 3:24:03 AM
Hello dev648237923,

From your description, you have an ASP.NET web application which use
ReportViewer to access SSRS reports on a remove server, all the servers
are in the same domain. However, you found that when the ASP.NET running
under the default network service account, it can not access the remote
SSRS server's report, report 401 error ,correct?

Based on my experience, you're suffering a windows authentication issue
between your ASP.NET webserver and the SSRS's server. The problem here is
also specific to the Network Service account on the ASP.NET server machine.
Generally, in windows 2003 domain, the NT AUTHORITY\NETWORK SERVICE
account just represent the machine account when access remote resources in
the same domain. For your scenario, it seems that the remote machine(SSRS
server) can not recognize the NETWORK SERVICE account from webserver and
report 401 error. I think you can perform the following test to verify
this:

** try using code in ASP.NET page to access the SSRS server machine 's file
system(UNC share) or directly access SQL Server (grant sufficient for the
ASP.NET server's machine account) to see whether it works. The following
article has described how to use NETWORK Service account to access remote
resource:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html
/PAGHT000015.asp?_r=1

** You can check the machine account of the ASP.NET webserver to see
whether it is correctly in the AD of the domain.

Anyway, this is likely a machine specific issue. Currently for testing or
developmentif you feel it ok to run the ASP.NET application under a custom
domain account, you can grant the custom domain account sufficient
permission for running ASP.NET application following the below article:

How To: Create a Service Account for an ASP.NET 2.0 Application
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html
/paght000009.asp?_r=1

Please feel free to let me know if you have any other finding or questions
on this.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 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 or complex
project analysis and dump analysis issues. 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/subscriptions/support/default.aspx.

==================================================



This posting is provided "AS IS" with no warranties, and confers no rights.



ASP.Net --> Report Server, got http 401 Unauthorized KenLin
12/21/2006 12:00:00 AM
How to use Direct access if we use ReportViewer???

regards,
Ken Lin

[quoted text, click to view]

AddThis Social Bookmark Button