Solved

The request failed with HTTP status 401: Unauthorized (Reporting Services)

Posted on 2010-11-18
27
4,726 Views
Last Modified: 2012-06-21
I have generated a report using reporting services 2008 and trying to display the report on the web page. The report runs locally and with the report manager. But when it is accessed from other machine, i get the "The request failed with HTTP status 401: Unauthorized" error.

I have done the following:
1) In the web.config, added the following element under the system.web section:
    <identity impersonate="true" />
2) Navigated to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa and, created a new DWORD named DisableLoopbackCheck with a value of 1. Restarted the server

Also i am using the below attached code.

Could anyone help me out what i am missing like do i need to pass any network credentials or something?

Thanks.




Private Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click



            Dim prmInput(0) As ReportParameter



            'Add Input Parameter

            prmInput(0) = New ReportParameter("intYear", ddlYear.SelectedValue)

            ReportViewer1.ServerReport.ReportServerUrl = New System.Uri(strReportServerUrl)

            ReportViewer1.ShowCredentialPrompts = False

            ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote

            ReportViewer1.ServerReport.ReportPath = "/XReports/X_XXXX"

            ReportViewer1.ServerReport.SetParameters(prmInput)

            ReportViewer1.ShowParameterPrompts = False

            ReportViewer1.ShowBackButton = False



    End Sub

Open in new window

0
Comment
Question by:cimscims
  • 14
  • 13
27 Comments
 
LVL 39

Expert Comment

by:lcohan
ID: 34165639
How is its “accessed from other machine” – do you connect to the report server or the report manager from the other machine and what browser are you using?
I assume you connect to the SSRS to access the report by the IP in URL – something like: http://111.111.111.111:9999/ReportServer
0
 

Author Comment

by:cimscims
ID: 34165720
I have a intranet web application.on click of a link on the menu, I am displaying the report on the page.I don't have problems if I do a remote desktop to the server and view the web page that has the report. Also I could see the report from the report manager.only problem is if I access the web page from my machine, I am getting the error message.
0
 
LVL 39

Expert Comment

by:lcohan
ID: 34166112
is the web app using the same nt login as for RDP and to access/view it via report manager?
if yes please make sure you put the full path in your web app ReportPath and grant access to the report URL as per link below:

http://msdn.microsoft.com/en-us/library/bb283249.aspx

From your code above I see you try to use webforms however please note that you can't use both forms and integrated security at the same time for the report security:

http://technet.microsoft.com/en-us/library/ms152899.aspx
0
 

Author Comment

by:cimscims
ID: 34166343
You are right. I am using Webforms. What is integrated security and report security?
0
 
LVL 39

Expert Comment

by:lcohan
ID: 34166531
"Integrated security" is NT security and relies on a domain/user login/authentication and all these are set at the web site level but I don't think you can have a mixed mode as per Microsoft documentation. So in other words you choose one or the other under your SSRS website security where the reports were deployed. Is it possible to use integrated or NT authentication in your web app? Maybe that would be the easiest if you are on a local network/intranet. if you need to access it from the web then indeed forms authentication is for you:

Forms Authentication requires that a person is present to enter credentials. For unattended applications that communicate directly with the Reporting Services Web service, Forms Authentication must be combined with a custom authentication scheme.

Forms Authentication is appropriate for Reporting Services when:

You need to store and authenticate users that do not have Microsoft Windows accounts, and

You need to provide your own user interface form as a logon page between different pages on a Web site.

Consider the following when writing a custom security extension that supports Forms Authentication:

If you use Forms Authentication, anonymous access must be enabled on the report server virtual directory in Internet Information Services (IIS).

ASP.NET authentication must be set to Forms. You configure ASP.NET authentication in the Web.config file for the report server.

Reporting Services can authenticate and authorize users with either Windows Authentication or custom authentication, but not both. Reporting Services does not support simultaneous use of multiple security extensions.
0
 

Author Comment

by:cimscims
ID: 34166859
I am using Windows authentication as the app is in intranet. Where can i find SSRS website security?
Find the settings for the web app in IIS 7.0
IIS-Authentication.jpg
IIS-AppPool.jpg
0
 
LVL 39

Expert Comment

by:lcohan
ID: 34166957
SSRS website security is usualy inherited from the default website from the SSRS server and if you expand that default website you should see two virtual websites used by SSRS - Report MAnager and Report Server. I would try enable anonymous authentication briefly to see if that solves the problem before going further. if you can't access it with anonymous enabled then it maybe something else.
0
 
LVL 39

Expert Comment

by:lcohan
ID: 34166989
Hm...you should have at least one DefaultAppPool under the app pools as far as I know it should run "integrated" security.
0
 

Author Comment

by:cimscims
ID: 34167032
You are right. There is  DefaultAppPool under the app pools which is running under 'Integrated' security. I just copied the specific one. Where can find default website from the SSRS server? Are you refering to the server where the reporting services are installed?
0
 

Author Comment

by:cimscims
ID: 34167083
Here is the IIS on the SSRS server
IIS-Website.jpg
0
 

Author Comment

by:cimscims
ID: 34167829
As i am using SSRS 2008, i think we cannot see the two virtual directories as it used to be in SSRS 2005.
0
 
LVL 39

Expert Comment

by:lcohan
ID: 34167935
I am also using SSRS 2008 on windows 2008 and SSRS 2005 on win 2003 as wqell and always the 2 websites for report manager/server are under the default web site on the SSRS box indeed.
0
 

Author Comment

by:cimscims
ID: 34168053
Are the websites created automatically? As you see in the screenshots in my earlier post, iis7.0 is empty on the ssrs 2008 box.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 39

Expert Comment

by:lcohan
ID: 34168234
The web sites are generated during the SSRS 2005 or 2008 configuration and you can start that tool on the SSRS server box WITHOUT any changes but to check where they are configured.
Check for Web service URL = Report Server and Report Manager URLs to see where they are located.
0
 

Author Comment

by:cimscims
ID: 34168395
I am on the way back to home. I will check and shall post tomorrow.thanks for your support.
0
 

Author Comment

by:cimscims
ID: 34172555
Good Morning lcohan. I could not find the physical path for the Web Service and Report Manager URL's. I have attached the screenshots for the sections.
WebServiceURL.jpg
ReportManageURL.jpg
0
 

Author Comment

by:cimscims
ID: 34172579
It seems SSRS doesn't create virtual directories in IIS anymore. Got something from web.
******************************************************************************************
RS 2005 and earlier uses IIS.

RS 2008 changed its architecture and IIS is not used at all. IIS does not
need to even be installed on the machine. Shich is nice for Windows 7
because Windows 7 home edition will now work.

--
Bruce Loehle-Conger
MVP SQL Server Reporting Services

Link : http://www.eggheadcafe.com/software/aspnet/35420948/ssrs-2008-and-reportserver-and-reports--iis-virtual-directories.aspx
******************************************************************************************
0
 
LVL 39

Expert Comment

by:lcohan
ID: 34173689
OK so you don't have it configured to use IIS (and that should be fine on SSRS2008) so your SSRS reporting service will be using  HTTP.SYS directly to listen for requests on a specific port that you define for report server URLs. Can that port be accessed from your web app?
Please see the link below that has sumarized all major SSRS changes and hopefully you find why you get the 401 error. There must be some permission issue - maybe is at the OS folder level? Are there any SQL Log errors or event viewer entries on the SSRSA box when you try is from your web app?

It is a interesting challange and I may try go the same route if we can find your answer as currently I have my 2008 SSRS split from SQL but runing still through IIS virtual web sites on a specific port that will need to be poked through the firewall which is a risk.

0
 
LVL 39

Expert Comment

by:lcohan
ID: 34173695
0
 

Author Comment

by:cimscims
ID: 34173810
I have checked the event logs on SSRS box and there are no events. As the Report server is running with a 'NetworkService' account, do i need to pass those credentials in the below method?

Private Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click

            Dim prmInput(0) As ReportParameter

            'Add Input Parameter
            prmInput(0) = New ReportParameter("intYear", ddlYear.SelectedValue)
            ReportViewer1.ServerReport.ReportServerUrl = New System.Uri(strReportServerUrl)
            ReportViewer1.ShowCredentialPrompts = False
            ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote
            ReportViewer1.ServerReport.ReportPath = "/XReports/X_XXXX"
            ReportViewer1.ServerReport.SetParameters(prmInput)
            ReportViewer1.ShowParameterPrompts = False
            ReportViewer1.ShowBackButton = False

    End Sub
 
0
 
LVL 39

Expert Comment

by:lcohan
ID: 34173871
Are you using win 7 on the client from where you access the report?
I suggest try run the app as admin even if you are local admin, and same through IE if you use the browser to access it.
0
 
LVL 39

Expert Comment

by:lcohan
ID: 34174029
According to Microsoft:
Network Service Account - The Network Service account is a built-in account that has more access to resources and objects than members of the Users group. but this may not be sufficient..
Would it be possible from your security policy point of view to start it as Local system instead or even better with a speciffic domain account that has local admin rigts on the SSRS box?



0
 

Author Comment

by:cimscims
ID: 34174355
I have to check with my Manager before changing it. He is not in today.
0
 

Author Comment

by:cimscims
ID: 34174663
ok. Let me give the details of my environment.  I have
1) TESTSQL running on Windows server 2008 R2 with SSRS 2008 and SQL Server 2008
2) TESTDEV running on Windows server 2008 R2 with IIS7.0
3) LOCALDEV running on XP with IE 6.0

1) When i login to to TESTDEV box and browse the report, it shows up
2) When i login to to LOCALDEV box and browse the report, it displays the 401 error.

What may be the difference in TESTDEV and LCOALDEV?

0
 
LVL 39

Expert Comment

by:lcohan
ID: 34175156
Well the OS and IE versions are diferent on TESTDEV  vs. LOCALDEV    
Do you use same nt login on both? are they on the same domain?
0
 

Author Comment

by:cimscims
ID: 34175229
Yes, i am using the same login and Domain. I think OS shouldn't matter. What do you say?
0
 
LVL 39

Accepted Solution

by:
lcohan earned 500 total points
ID: 34175383
True, OS should not matter but is weir that same login through different browser dones not work if you hit exactly the same URL. It may be the browser settings on the XP that is causing the error. here's a bit more detail about 401 http errors: http://www.checkupdown.com/status/E401.html
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction In the following article I’ll be discussing and demonstrating several different ways of how images can be put on a report. I’m using SQL Server Reporting Services 2008 R2 CTP, more precisely version 10.50.1352.12, but the methods ex…
It is helpful to note: This is a cosmetic update and is not required, but should help your reports look better for your boss.  This issue has manifested itself in SSRS version 3.0 is where I have seen this behavior in.  And this behavior is only see…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Viewers will learn how the fundamental information of how to create a table.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now