locked
The request failed with HTTP status 401: Unauthorized. RRS feed

  • Question

  • User-1132342797 posted

    Hi,

    I now is using asp.net (vbscript) and SQL 2005 Reporting Services.

    I have create a report from SQL Server Business Intelligence Development Studio,  on the sql report application is work, but after I plug-into reportviewer show me below message.

    use Remote mode

    The request failed with HTTP status 401: Unauthorized.

    for Local mode

    • A data source instance has not been supplied for the data source 'databasename'.
    thk
    Tuesday, April 25, 2006 4:01 AM

All replies

  • User1840398364 posted

    The solution is here http://www.taznetworks.com/rss/2006/03/crm-30-sbe-sql-reporting-error.html

    and / or here http://support.microsoft.com/default.aspx?scid=kb;en-us;896861

    This was driving me crazy so I am posting the answer everywhere I saw someeone else asking and getting no answers.

    Tuesday, May 2, 2006 4:45 PM
  • User1760017319 posted
    Hi,
    I have just installed MSRS 2005 & created & deployed a report at Http://<MySrvr>/ReportServer & report path is RerportProject/SampleReport
    using VS 2005 I just dragged & dropped the report viewer control on a web page & set the properties as follows
    ServerReport -> ReportPath = RerportProject/SampleReport and ReportServerUrl = Http://<MySrvr>/ReportServer and when I run this page I am getting this error "The request failed with HTTP status 401: Unauthorized.",

    I've also tried with writing the following code in the page load event
    ReportViewer1.ServerReport.ReportPath = "/ReportingProject/EmpReport";
    ReportViewer1.ServerReport.ReportServerUrl =new Uri("http://cs042/ReportServer");
    even this is causing tha same problem

    I even tried this solution
    1. Click Start, click Run, type regedit, and then click OK.
    2. In Registry Editor, locate and then click the following registry key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa
    3. Right-click Lsa, point to New, and then click DWORD Value.
    4. Type DisableLoopbackCheck, and then press ENTER.
    5. Right-click DisableLoopbackCheck, and then click Modify.
    6. In the Value data box, type 1, and then click OK.
    7. Quit Registry Editor, and then restart your computer.
    but it still not working.

    I've worked on MSRS 2000 also so I added the old ReportViewer control on to my webpage with that the report is displayed fine, i dont under stand why the reportviewer control of 2005 is causing problem


    Tuesday, May 9, 2006 4:38 AM
  • User1760017319 posted
    Yes I've done it. You just need to add identity impersonate = true in the web.config, that's it..
    Tuesday, May 9, 2006 8:36 AM
  • User714943673 posted

    Hello,

     

    I'm trying to display a RS report deployed on a remote SQL server in a Report viewer control..
    I can succesfully call the report from http://SQLSERVER/Reports/Folder/The_report
    I've set the ReportServerUrl to http://SQLSERVER/reports and the ReportPath property to : /TestRSReport/webstats_H_A_B

    but still no success even after applying the tricks mentioned above in this thread...

    Any idea??

    Thursday, September 28, 2006 8:50 AM
  • User-217959266 posted

    Yes I've done it. You just need to add identity impersonate = true in the web.config, that's it..

    Both my web server and the SSRS Server's Virtual Directory "ReportServer" is already <identity impersonate = true>

    Still fail, what can i do???? HELP!!!!!!!!!!!!!

    Thursday, December 21, 2006 4:44 AM
  • User1201081948 posted

    all i did was added <identity impersonate = true />  within <system.web> tag in web.config file. and now it's working!

    Tuesday, October 9, 2007 11:44 PM
  • User-1496502028 posted

     What you need to do is to impersonate using a user gain browse privileges on the reporting server

    check this link http://support.microsoft.com/kb/306158 

    http://www.odetocode.com/Articles/156.aspx 

    Tuesday, October 9, 2007 11:59 PM
  • User1201081948 posted

    Inserting <identity impersonate="true" /> tag in web.config works well if my web application is running on my local web server. But it fails when I run the web application from a remote web server.

    I had to grant Browser permission to the web server account ID at the item-level security of the report. And this works well now.

    Sunday, October 21, 2007 11:42 PM
  • User1896052318 posted

    Hey, thats right, when i set tag identity impersonate="true" in web config, it just work as well when i browse the report in my local web server. But not work when i browsed it in client. Can you tell me how to grant Browser permission to the web server account ID at the item-level security?

    Wednesday, November 14, 2007 8:43 PM
  • User1201081948 posted

    You just need to find out your web server account ID. This ID is displayed on the web page as part of the error message:

     The permissions granted to user 'xxx' are insufficient for performing this operation. (rsAccessDenied)

    xxx is the user id you should add using Report Manager.

    Under Report Properties -> Security -> [Click on New Role Assignment] -> [Type in user id] -> [Check Browser Role] -> [Hit Ok] .

    Wednesday, November 14, 2007 9:27 PM
  • User-1496502028 posted

    You have to imerspnate using auser who has priviliges on the reports as follow

    <identity impersonate="true" userName="Domain\username" password="Passwors"/>

    Sunday, November 18, 2007 9:11 AM
  • User1523068475 posted

    Hi,

    i solve this error adding in Home page of reporting services management, the aspnet user checking only View ;

    i wrote this, if can be useful to someone.

     

    Tuesday, November 20, 2007 10:27 AM
  • User1896052318 posted

    identity impersonate="true" userName="Domain\username" password="Passwors"/

    If this credential is using to access to the report only or used as user credential in my OLAP?
    Because i had already set the security to every user for each report in my OLAP Roles. In my case not every user can access to all report.

    Do i have to set this configuration to all user who can login to my application?

    Tuesday, November 20, 2007 10:20 PM
  • User1201081948 posted

    it sounds like you should create a user group and assign browser right to this group.

    and then all you need to do is add any user who needs access to the report to this user group. this will save you the need to add every user to your reports!

    Tuesday, November 20, 2007 11:14 PM
  • User1896052318 posted

    Wow it seems i have a lot of work to do ^^

    But i have a problem to doing this because the user who will access to the application is defined by real time (set by the administrator), so when user has been created i have to access the reporting services again and add this user to the group manually. So i have to check every minute when user has been created. And so on for edited or deleted user. ^^'

    Your suggestion to set the tag identity impersonate="true" userName="Domain\userID" Password="p@ssword" is working properly, but i think the security that i already set, will not be worked. Because the report server has only know for this user only.

    Maybe the main problem is when i accessing the reporting services (OLAP) via my application, i need to send the user credential (which is the current user who log in to my application) to the OLAP.

    Please advice, thank you.

    Wednesday, November 21, 2007 12:06 AM
  • User1896052318 posted

    Wow it seems i have a lot of work to do ^^

    But i have a problem to doing this because the user who will access to the application is defined by real time (set by the administrator), so when user has been created i have to access the reporting services again and add this user to the group manually. So i have to check every minute when user has been created. And so on for edited or deleted user. ^^'

    Your suggestion to set the tag identity impersonate="true" userName="Domain\userID" Password="p@ssword" is working properly, but i think the security that i already set, will not be worked. Because the report server has only know for this user only.

    Maybe the main problem is when i accessing the reporting services (OLAP) via my application, i need to send the user credential (which is the current user who log in to my application) to the OLAP.

    Please advice, thank you.

    Wednesday, November 21, 2007 12:10 AM
  • User284220607 posted

    Hi,

    How do you grant browser permmission to the web server accountID on a report server? I got this account unknown error.

    Thanks,

    Tuesday, February 5, 2008 12:01 PM
  • User-1496502028 posted

    Hi,

    you can sent the cuent user crediantion by implementing the report creaduantion class

     Implements IReportServerCredentials Interface

    1.       ReportCredentials(string userName,string password,string domain)à Constructor.

    2.       bool GetFormsCredentials(out Cookie authCookie, out string userName, out string password, out string authority)

    but i need more information about your appliaction so i can tell you the best approach

    Thursday, February 7, 2008 5:57 AM
  • User-1492884371 posted

     Send credentials using the ReportServerCredentials..

     

    SQL Server Reporting Service (SSRS) - HTTP Status 401 Unauthorized Error

     

    Saturday, May 24, 2008 7:09 AM
  • User1535544631 posted

    THANKS A MILLION ITS WORKING FOR ME AFTER ADDING IMPERSONATE AND USER NAME...

     [Yes]

    Wednesday, September 17, 2008 4:10 PM
  • User1535544631 posted
    HOW to mark as answer??
    Wednesday, September 17, 2008 4:23 PM
  • User-199157806 posted

    just wanted to confirm that this LSA entry fixed my problem as well.

    • server name different from the DNS / HTTP header name used
    • left existing website intact, added dedicated site for RS
    • within RSWebApplication.config, changed ReportServerUrl to match server/reportserver path
    • "  changed ReportServerVirtualDirectory to <blank>
    • added the DisableLoopbackCheck registry entry as described

    restarted IIS and it worked fine, no server reboot required.

    Tuesday, January 27, 2009 1:21 PM
  • User564488466 posted

    Hate to bring this up, but i also have the same error when i try to view the report on the remote server (works fine on local).

    I set <identity impersonate="true"/> didnt help. I dont have access to our IIS or the Reporting Server, im only able to deploy on it, so cant mess with the registry keys and such. 

    Any idea what can cause that?


    By the way i use Windows authentication with Membership enabled. 


    Wednesday, January 6, 2010 12:26 PM
  • Monday, November 29, 2010 6:21 PM
  • User2056721336 posted

    Dear All,

    The belwo solution worked for me.

    My Application server and Report serve was different.

    I tried with below option but no success.

    1. Click Start, click Run, type regedit, and then click OK.
    2. In Registry Editor, locate and then click the following registry key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa
    3. Right-click Lsa, point to New, and then click DWORD Value.
    4. Type DisableLoopbackCheck, and then press ENTER.
    5. Right-click DisableLoopbackCheck, and then click Modify.
    6. In the Value data box, type 1, and then click OK.
    7. Quit Registry Editor, and then restart your computer.

    I proceed with below option.

    Reporting service implemts has  IReportServerCredentials which needs to be implemented. As below.

    public

    class ReportServerCredentials :

    IReportServerCredentials

    {

    #region

    Class Memebers

    private string username;

    private string password;

    private string domain;

    #endregion

    #region

    Constructor

    publicReportServerCredentials()

    {

    }

    public ReportServerCredentials(stringusername)

    {

    this.Username = username;

    }

    public ReportServerCredentials(string username, string password)

    {

    this.Username = username;

    this.Password = password;

    }

    public ReportServerCredentials(string username, string password, string domain)

    {

    this.Username = username;

    this.Password = password;

    this.Domain = domain;

    }

    #endregion

    #region

    Properties

    public string Username

    {

    get

    {

    return this.username;

    }

    set

    {

    this.username = value;

    //if (username.Contains("\\"))

    //{

    // this.domain = username.Substring(0, username.IndexOf("\\"));

    // this.username = username.Substring(username.IndexOf("\\") + 1);

    //}

    //else

    //{

    // this.username = username;

    //}

    }

    }

    public string Password

    {

    get

    {

    return this.password;

    }

    set

    {

    this.password = value;

    }

    }

    public string Domain

    {

    get

    {

    return this.domain;

    }

    set

    {

    this.domain = value;

    }

    }

    public WindowsIdentity ImpersonationUser

    {

    get

    {

    return null; // not use ImpersonationUser

    }

    }

    public ICredentials NetworkCredentials

    {

    get

    {

    // use NetworkCredentials

    return new NetworkCredential(Username,Password,Domain);

    }

    }

    #endregion

    #region

    Methods

    public bool GetFormsCredentials(out Cookie authCookie, out string user, out string password, out string authority)

    {

    // not use FormsCredentials unless you have implements a custom autentication.

    authCookie =

    null;

    user = password = authority =

    null;

    return false;

    }

    #endregion

    Than call in your ASP.NET web page  before ReportServerUrl

    IReportServerCredentials reportCredentials = new ReportServerCredentials(ReportServerUserId, ReportServerPassword, ReportServerDomain);

    rptVwr.ServerReport.ReportServerCredentials = reportCredentials;

    rptVwr.ServerReport.ReportServerUrl = new System.Uri(ReportServerUrl);

    You are done..

    Monday, July 25, 2011 8:54 AM
  • User163295502 posted

    There is a simpler way to solve this problem. Give "Browser" permission on the Rporting Services folder to the users or groups you want.

    Wednesday, December 7, 2011 3:41 PM