none
401 Unauthorized Error when accessing SSRS report from ASP.NET Web App RRS feed

  • Question

  • Hello. Hopefully this is posted in the correct forum. I'm running into a little situation and any assistance would be greatly appreciated.

    I just recently created an ASP.NET web app using Visual Studios 2010 Ultimate; VB code. I have a reporting section which utilizes the ReportView control to retrieve SSRS reports from an SSRS report server; using SSRS 2008 R2, created in Visual Studios 2008. Everything works perfectly on my local desktop. The issues come when I post the web app onto our web server and try to access the web app remotely; the server is a Windows 2008 Server R2 Standard using IIS 7.  Using application pool ASP.NET 4.0 Integrated. For authentication, Anonymous Auth is Disabled, ASP.Net Impersonate is Enabled, Basic Auth is Disabled, Digest Auth is Disabled, Forms Auth is disabled, and Windows Auth is enabled.

    Accessing the web app on the server itself works as it should as with the SSRS reporting section within the web app. The issue comes when I try to access the web app's URL from a different desktop other than the server. All parts of the webb app works except for the reporting section. I get a "The request failed with HTTP status 401: Unauthorized." In our SSRS report manager server, I made sure that the datasource of the reports had the proper credentials; selected "Credentials stored securely in the report server".

    So once again...summed up.. web app on web server cannot access SSRS on a different server. 401 Unauthorized error.

    I'm not sure if something in IIS is configured wrong, or what.. any help would be greatly appreciated. Thanks.

    Friday, July 29, 2011 2:43 PM

Answers

  • Hi Kanguru401,

    Thanks for posting your question here. Based on my research and past experiences, I would give you below suggestion.

    If you enabled the Windows Authentication in IIS, when one user accesses the web application, the user’s credential is passed to the report server. Since the server does not recognize computer's local credentials, it throws "HTTP status 401: Unauthorized."

    You would have to change the reporting services authentication mode to "Basic" from Windows.

    Open RSReportServer.config (by default, C:\Program Files\Microsoft SQL Server\MSRS10.MSSQLSERVER\Reporting Services\ReportServer) and replace

    <Authentication>
    <AuthenticationTypes>
    <RSWindowsNTLM/>
    </AuthenticationTypes>
    <EnableAuthPersistence>true</EnableAuthPersistence>
    </Authentication>

    with following entry -

    <AuthenticationTypes>
    <RSWindowsBasic/>
    </AuthenticationTypes>

    Hope it helps you. If the issue still exists, please feel free let me.

    Thanks,
    Sharp Wang


    Please remember to mark the replies as answers if they help you and unmark them if they provide no help.
    Wednesday, August 3, 2011 10:37 AM
    Moderator

All replies

  • Hi Kanguru401,

    Thanks for posting your question here. Based on my research and past experiences, I would give you below suggestion.

    If you enabled the Windows Authentication in IIS, when one user accesses the web application, the user’s credential is passed to the report server. Since the server does not recognize computer's local credentials, it throws "HTTP status 401: Unauthorized."

    You would have to change the reporting services authentication mode to "Basic" from Windows.

    Open RSReportServer.config (by default, C:\Program Files\Microsoft SQL Server\MSRS10.MSSQLSERVER\Reporting Services\ReportServer) and replace

    <Authentication>
    <AuthenticationTypes>
    <RSWindowsNTLM/>
    </AuthenticationTypes>
    <EnableAuthPersistence>true</EnableAuthPersistence>
    </Authentication>

    with following entry -

    <AuthenticationTypes>
    <RSWindowsBasic/>
    </AuthenticationTypes>

    Hope it helps you. If the issue still exists, please feel free let me.

    Thanks,
    Sharp Wang


    Please remember to mark the replies as answers if they help you and unmark them if they provide no help.
    Wednesday, August 3, 2011 10:37 AM
    Moderator
  • Hi Sharp,

    Thanks for your reply and sorry to get back to this so late. I tried changing the Authentication on the SSRS server's RSReportServer.config file as mentioned. I rebooted the server and still get the 401 Unauthorized error. Any other suggestions that I could try? I'm really hitting a wall on this one.

    Thanks

    Tuesday, August 9, 2011 2:47 PM
  • Hi Kanguru401,

    Thanks for your reply. For the problem, please check that had you checked the checkbox of Use as Windows credentials when connecting to the data source  for your datasource in Report Manager.

    1. Open the Report Manager in the browser, locate to the DataSource of the report.

    2. Hover over the report, and click the drop-down arrow, select Manage.

    3. In the Properties tab, below the Credentials stored securely in the report server  ridiobutton, type in the Username and password with correct credential of windows account, remember to check the checkbox of Use as Windows credentials when connecting to the data source , click Apply button.

     

    If the issue still exists, please let me know.

    Thanks,
    Sharp


    Please remember to mark the replies as answers if they help you and unmark them if they provide no help.
    Wednesday, August 10, 2011 1:38 AM
    Moderator
  • I am also facing the same issue. It is not resolved by using below answers. Kindly help me in resolving this issue
    Thursday, December 20, 2012 9:12 AM
  • Hi Kanguru401,

    Please follow this thread, this may able to help you - > http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/69970b9d-c209-40e1-9247-e742ebca7869

    To implement customcredential class please refer this link:

    http://social.msdn.microsoft.com/Forums/eu/sqlreportingservices/thread/724182a8-e42a-4603-822c-3ff836845cdb



    Regards Harsh

    Thursday, December 20, 2012 9:29 AM
  • I know it is too old post, but we ran it to similar issue. Opened a ticket with MS and this is how we got it fixed without changing Authentication Type to "Basic":

    Open registry editor - regedit. And navigate to:

    HKEY_LOCAL_MACHINE -> SYSTEM -> CurrentControlSet -> Control -> Lsa

    Look for key "DisableLoopbackCheck" and check the value in this key. If it is 0, change it 1.

    If this key does not exit, create a new key with the same name - "DisableLoopbackCheck" - and assign it the value of 1.

    Restart the server. And the issue should be fixed. 

    Cheers,

    Vivek

    • Proposed as answer by NayanM Saturday, October 5, 2019 8:27 AM
    Thursday, May 31, 2018 7:24 PM
  • Great. This resolved our problem. Thanks.
    Thursday, May 30, 2019 8:08 AM