The request failed with HTTP status 401: Unauthorized RRS feed

  • Question

  • User1514365461 posted

    Hello Team,

    I am trying to test LogonUser() for my report viewer web application. When i try to connect I encountered this error:

    The request failed with HTTP status 401: Unauthorized

    Imports System.Web.Services.Protocols
     Imports localhost_reportingService.ReportingService2010
     Imports Microsoft.VisualBasic
        Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
                Dim rs As New localhost_reportingService.ReportingService2010
                Dim UserName As String = TextBox1.Text
                Dim pass As String = TextBox2.Text
                Dim myauthortity As String = Nothing
                rs.LogonUser(UserName, pass, myauthortity)
                Label4.Text = "Authentication Successful"
                ' Response.Redirect("http://www.in.yahoo.com")
            Catch ex As Exception
                Label5.Text = "Error in Authentication"
                Label3.Text = ex.Message.ToString
               ' Response.Redirect("http://www.google.co.in")

    Currently I am trying in local machine but not able to connect / validate with 

    Please guide me if my approach is correct to check and what changes i need to in :-
    a) config file
    b) or any other places i am missing :(

    Wednesday, November 13, 2013 11:33 AM


  • User816363141 posted


    Generally, the 401 error occurs when the user is not authorized to the Report Server. Besides, if the Reporting Services is configured to use Kerberos, however, we didn't register Service Principal Name (SPN) for the account the Reporting Services is running under, this error will occur as well.

    To resolve the issue, you can simply configure the data source to use stored credentials. If you have Kerberos enabled, you can also address the issue by registering SPN for the report server service. For the detailed information, please see:

    If you have any more questions, please feel free to ask.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, November 15, 2013 4:09 AM