401: Unauthorized only when providing auth line (8.1 SP6)

Hi,
          I have a servlet under 8.1. Servlet has it's own authentication mechanism, only used for certain paths. Most of the paths do not require HTTP authentication, only some do. There is a programatic client that contacts the paths that require HTTP authorization, and provides the necessary header lines. This worked great in SP3, but in SP6 the authentication doesn't work anymore because apparently WebLogic server now tries to authenticate the user, and the user doesn't exist in WebLogic realm, nor I have any intention to create it there. Anonymous requests still work perfectly normal, only those requests that have any HTTP auth in them are problem....
          Something changed in SP4-SP6? Is it possible to instruct WebLogic to not attempt any authentication even when the header line is there ?
          weblogic.xml can be looked at at http://manticore.2y.net/temp/wl_config.xml.
          Thanks !

Yeah, BEA doesn't seem to wish to pay any particular attention to breaking this behavior.
          I chased this down with a lot of disassembling and instrumenting their code, and arrived to the conclusion that this is not configurable at all. Before, the code was passing the request in, if nothing within weblogic wanted to check the credentials, now this logic is a lot more complicated, and some default authentication is always performed, otherwise the request is failed with the 401. The only fix seems to be to create the corresponding weblogic user and password...

Similar Messages

  • 401 Unauthorized Error When calling a SharePoint REST web service from SharePoint 2013 Workflow

    We have our Workflow Manger installed on the same server as our SharePoint 2013 WFE development environment. When creating a SharePoint 2013 Workflow all Calls to a SharePoint 2013 REST web service results in a 401 Unauthorized error.
    As an example I created a simple workflow that should return a JSON result. The REST Url returns the results in the browser without error.
    Set Variable:webServiceUrl to https://<hostnamedsitecollection>/_vti_bin/client.svc/web/lists/getbytitle('ISR%20Approvers')/Items?$select=Title&$filter=Title%20eq%20%27General%27
    then Build{...} Dictionary (Output to Variable:requestHeaders)
    then Call [%Variable:webServiceUrl%] HTTP web service with request (ResponseContent to Variable:responseContent |ResponseHeaders to responseHeaders | ResponseStatusCode to Variable:responseCode)
    The RequestHeader is set to the requestHeaders variable though the web service call properties
    then Log Variable:responseCode to the workflow history list
    After manually running the workflow in SharePoint on a list item in the ISR Approvers list it Logs "Unauthorized" in the Workflow History Log. It does this with every SharePoint REST web service call that I have tried through the workflow.
    It doesn't have anything to do with the Workflow Manger being installed on the same machine as the SharePoint WFE does it?
    Thank You for any insight

    Hi,
    According to your post, my understanding is that you had 401 Unauthorized Error when calling a SharePoint REST web service from SharePoint 2013 Workflow.
    Please make sure you use the ‘Call HTTP Web Service’ correctly.
    You can enter the URL into the brower to check whether it is correctly.
    You need to
    create the Request header requestHeaders
    using a Dictionary:
    Accept : application/json;odata=verbose
    Content-Type : application/json;odata=verbose
    To associate the
    requestHeaders variable, select the Call action
    property, set the RequestHeaders property to
    requestHeaders.
    Please refer to the following articles:
    Working with Web Services in SharePoint 2013 Workflows using SharePoint Designer 2013
    Calling the SharePoint 2013 Rest API from a SharePoint Designer
    Workflow
    In addtion, you need to make sure you install the workflow manager correctly.
    More information:
    Install and configure workflow for SharePoint Server 2013
    Known Issues in Workflow Manager 1.0
    Troubleshooting Workflow Manager 1.0 Management and Execution
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • (401) unauthorized error when accessing web service....

    Hello people! Can someone could possibly help me out. I'm try to consume a web service in .net technology. This was supposedly working already but lately I'm already given a (401) unauthorized error when consuming the web services. Here the code that was working couple of days ago....
    package samples;
    import org.apache.axis.client.Call;
    import org.apache.axis.client.Service;
    import org.apache.axis.encoding.XMLType;
    import javax.xml.namespace.QName;
    public class LogIn
         private String url = "http://www-cebu/apps/webservices/fscservice.asmx?wsdl";
         private String action="FSC Services/LogIn";
         private String result="";
         private String username="";
         private String password="";
         private String domain="";
         public LogIn(String username, String password,String domain)
              this.username = username;
              this.password = password;
              this.domain = domain;
              try
                   Service service = new Service();
                   Call call = (Call)service.createCall();
                   call.setTargetEndpointAddress(new java.net.URL(url));
                   call.setOperationName(new QName("FSC Services/LogIn","LogIn"));
                   call.addParameter("username",org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);
                   call.addParameter("password",org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);
                   call.addParameter("domain",org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);
                   call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);
                   call.setUseSOAPAction(true);
                   call.setSOAPActionURI(action);
                   result = (String)call.invoke(new Object[] {username,password,domain});
              catch (Exception e)
                   System.err.println(e.toString());
         public String getResult()
              return result;     
         public static void main(String [] args)
                   LogIn test = new LogIn("username","password","domain");     
                   System.out.println(test.getResult());
    }

    1. Use iFrame to show you report from Resporting Services in your Web App.
    Or :
    2. Use Report Viewer in your Web App if you use .NET, and use this code to pass your parameters :
    ReportViewer1.ServerReport.Credential = new System.Network.NetworkCredential(“your name”, “your password”, “your domain”);

  • 401 Unauthorized Error when Registering Workflow Manager

    I have installed the workflow manager successfully. However, when I try to run Register-SPWorkflowService I get a 401 Unauthorized error. I am running SharePoint 2013 Management Shell as administrator.
    When I use internet explorer to browse to https://FQDNofServer:12290 I get prompted for my password 3 times and then get the Not Authorized Error here as well. I have tried this from the local host as well as remote machines with the same result therefore,
    I don't think I need to disable loopback check.
    My user is a member of the Workflow AdminGroup as well as a local admin, farm administrator and I also added my account as an administrator for the Workflow Service Application in Central Administration. I also tried giving the workflow service account full
    read on the web application.
    I cannot find anything in the ULS logs or windows event viewer logs when the login fails. Any help would be appreciated.
    Thank You.

    Hi,
    Glad to hear that you solve this issue, thanks for your sharing.
    Thanks,
    Linda Li                
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Linda Li
    TechNet Community Support

  • Getting 401 Unauthorized error when accessing Resource History in OIM11gR2

    Hi,
    I am receiving the following error (In the Resource Histroy Popup window) when I tried to access the Resource History for completing a User provisioning (DB Resource using Oracle DB connector).
    I have setup OIM 11g R2 on Windows 2008 Server Enterprise R2 with Oracle DB 11g R2
    Error 401--Unauthorized
    From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
    10.4.2 401 Unauthorized
    The request requires user authentication. The response MUST include a WWW-Authenticate header field (section 14.46) containing a challenge applicable to the requested resource. The client MAY repeat the request with a suitable Authorization header field (section 14.8). If the request already included Authorization credentials, then the 401 response indicates that authorization has been refused for those credentials. If the 401 response contains the same challenge as the prior response, and the user agent has already attempted authentication at least once, then the user SHOULD be presented the entity that was given in the response, since that entity MAY include relevant diagnostic information. HTTP access authentication is explained in section 11.
    I have read in other forum links that we need to configure the Authorization policies from OES APM console.
    I have setup the APM console, but I am not sure how to configure this related to my scenario
    I couldn't figure out what policies to be configured for my requirement under Application---->OIM----->oimdomain----->Authorization policies in APM console.
    I request experts to help on this as I am completely stuck here.
    Thanks,
    Madhu

    Hi user9212679,
    I am able to resolve the issue by reconfiguring the Domain properly with my FQDN of my VM.
    Earlier I was using my IP Address instead of FQDN and but the OIM is taking the FQDN of the machine and throwing 401 Unauthorized error.
    But I appreciate you help as it gave me clue of what could be wrong.
    Thanks,
    Madhu

  • 401 Unauthorized Message - when trying to access asmx-webservice from a SP 2013 Workflow

    Hello everybody!
    I made a workflow for sharepoint 2013, including the "call http web service"-action. Therein I am trying to access https://mysp.com/sites/mysite/_vti_bin/lists.asmx via GET Request. So nothing fancy one might think, but somehow it is:
    I am logging the response code returned from the request which gives me a 401 unauthorized.
    It is the same with every other asmx webservice (like webpartpages.asmx or copy.asmx).
    If I GET a REST webservice like /_api/lists it works fine.
    Also if I do the same GET request to the asmx from browser or any other client (like Postman App from Google Chrome) it works fine. 
    Is there some kind of special issue when authorizing from a workflow to asmx?
    or how do I authorize my workflow against a asmx - webservice?
    My environment: I am working with Sharepoint Online 2013 and Sharepoint Designer 2013.
    Thank you for your help...

    Hi,
    For your issue, please make sure you have activated the “Workflow can use app permissions” Web-scoped feature and grant full control permissions to the workflow.
    For more information, please refer to the blog:
    http://sharepointryan.com/2013/09/10/create-a-sharepoint-site-spweb-using-rest-in-spd-2013-workflow/
    Best Regards,
    Eric
    Eric Tao
    TechNet Community Support

  • 401 Unauthorized error when calling a webservice

    Have ColdFusion 11 installed, I have created a hello web service and I am trying to call it.  Each time I try to call the web service I get an error 401 Unauthorized.  I am not sure if I need to configure something more on the ColdFusion server, IIS or something else.
    <cfcomponent displayname="Hello">
    <cffunction name="helloWorld" returntype="string" access="remote">
         <cfreturn "Hello World!">
        </cffunction>
    </cfcomponent>
    <cfinvoke
      webservice="http://MyServer/Hello.cfc?wsdl"
      method="helloWorld"
      returnvariable="ws" refreshwsdl="yes">
    </cfinvoke>
    <cfdump var="#ws#">

    It appears that you have inadvertently enforced HTTP authentication. If so, you will have to include the attributes, username="your_username" and password="your_password" in the cfinvoke tag.

  • 10.4.2 401 Unauthorized error when i secured my project

    Hi ,
    I secured my application with authentication and authorization with default login page and error page.
    After i assigned users for an application role and doing grants for all the webpages and taskflows needed.. i am unable to login successfully into app.
    i get
    Error 401--Unauthorized
    From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
    10.4.2 401 Unauthorized
    The request requires user authentication. The response MUST include a WWW-Authenticate header field (section 14.46) containing a challenge applicable to the requested resource. The client MAY repeat the request with a suitable Authorization header field (section 14.8). If the request already included Authorization credentials, then the 401 response indicates that authorization has been refused for those credentials. If the 401 response contains the same challenge as the prior response, and the user agent has already attempted authentication at least once, then the user SHOULD be presented the entity that was given in the response, since that entity MAY include relevant diagnostic information. HTTP access authentication is explained in section 11.
    Any1 please let me know y this issue arises..
    Prabas

    did u grant permission for the taskflow and the page in jazn-data.xml file?

  • 401 Unauthorized Error when accessing a task from REST API which contains Role or Privilege in Access Control definition

    Hi Team,
    As of IDM 7.2 SP8 patch2, when we use Enterprise role or Privilege in the access control definition of a task, accessing this task from UI5 i.e REST API is giving unauthorized error even though user is already having the required role or privilege.
    But the task is working fine if we use fixed user ID or keeping blank value in allowed users field.
    Attached the current access control definition of the task we configured & the error message info for reference
    Regards,
    Venkata Bavirisetty

    Hi Ralitsa,
    Thanks for your response and sorry for late reply.
    The XXXX in role is not used as a wild card. the name itself is in that format. I have searched the role and then selected from search list.
    Let me know if you need any clarifications?
    Refards,
    Venkata Bavirisetty

  • 401: Unauthorized when creating report data source in sharepoint 2010

    Hi All,
    I am getting 401: Unauthorized error when trying to create a report datasource in sharepoint 2010. Same login is able create to datasource in one system,, but only with one system it causing this issue.
    Is it system or browser issue ? Please let me know.
    Soumya Das

    Hello Soumya Das,
    Sounds like a system issue, can you check your ULS logs if you see some more information on the HTTP 401 Unauthorized?
    Btw, have you also checked the Reporting Services configuration. Maybe this article can help:
    http://technet.microsoft.com/en-us/library/bb326356(v=sql.105).aspx
    - Dennis | Netherlands | Blog |
    Twitter

  • ReportViewer & IReportServerCredentials WORKS within Domain; FAILS with Cross-Domain request:HTTP status 401: Unauthorized

    The IReportServerCredentials approach with the ReportViewer control is working fine within a domain, but I get a 401 not authorized error for a Web IIS server trying to call a SSRS server in another domain. I've see plenty of helpful postings on the use
    of IReportServerCredentials but nothing that provides suggestions for this cross domain issue. Hope someone has some ideas on this one. Thanking you in advance for your response.
    Using VS 2008 VB.NET web app with ReportViewer control Version=8.0.0.0.
    Outside domainA Web Server IIS 8. OS = Windows NT 6.2;
    Inside domainA Windows 7 desktop; Inside domainA Windows Server 2003
    SSRS using windows authentication and on SQL Server 2012. OS = Windows NT 6.2
    The processing described below successfully produces a report when the web server app runs on a machine in the same domain as the SSRS server. For the "same domain" web app, both Win 7 desktop VS 2008 development server and Windows 2003 IIS 6 have
    been tested successfully.
    The report fails with error "The request failed with HTTP status 401: not authorized " when the web app is run from a windows IIS 8 machine (outward or Internet facing web server) that is not in the domain of the SSRS server. The ReportViewer control
    credentials (provided by IReportServerCredentials and taken from the web.config file) match a domain account in the same domain as the SSRS
    server and one that has browser permission on the report folder. The same credentials are used successfully for reports requested from within the SSRS domain.
    One interesting thing is that on the Internet facing web server, I can access the report via a browser request. So it is possible to have a user request coming from the Internet facing machine get through the SSRS windows authentication. Just does not
    work for the ReportViewer.
    Using IReportServerCredentials interface per example provided by Microsoft msdn site. Code listed below.
    IReportServerCredentials would appear to be a viable approach because it can pass credentials of a windows account known to the SSRS server, but not known to the client machine. By the way, database calls to SQL Server in domainA using a SQL Server
    native login account work fine. So the network support communication to a domain that the web server does not belong to.
    <Serializable()> _
    Public NotInheritable Class MyReportServerCredentials
        Implements IReportServerCredentials
        Public ReadOnly Property ImpersonationUser() As System.Security.Principal.WindowsIdentity _
            Implements IReportServerCredentials.ImpersonationUser
            Get
                'Use the default windows user.  Credentials will be
                'provided by the NetworkCredentials property.
                Return Nothing
            End Get
        End Property
        Public ReadOnly Property NetworkCredentials() As ICredentials _
                Implements IReportServerCredentials.NetworkCredentials
            Get
                'Read the user information from the web.config file. 
                'By reading the information on demand instead of storing
                'it, the credentials will not be stored in session,
                'reducing the vulnerable surface area to the web.config
                'file, which can be secured with an ACL.
                'User name
                Dim userName As String = _
                    ConfigurationManager.AppSettings("MyReportViewerUser")
                If (String.IsNullOrEmpty(userName)) Then
                    Throw New Exception("Missing user name from web.config file")
                End If
                'Password
                Dim password As String = _
                    ConfigurationManager.AppSettings("MyReportViewerPassword")
                If (String.IsNullOrEmpty(password)) Then
                    Throw New Exception("Missing password from web.config file")
                End If
                'Domain
                Dim domain As String = _
                    ConfigurationManager.AppSettings("MyReportViewerDomain")
                If (String.IsNullOrEmpty(domain)) Then
                    Throw New Exception("Missing domain from web.config file")
                End If
                Return New NetworkCredential(userName, password, domain)
            End Get
        End Property
        Public Function GetFormsCredentials(ByRef authCookie As Cookie, _
                       ByRef userName As String, _
                       ByRef password As String, _
                       ByRef authority As String) As Boolean _
            Implements IReportServerCredentials.GetFormsCredentials
            authCookie = Nothing
            userName = Nothing
            password = Nothing
            authority = Nothing
            'Not using form credentials
            Return False
        End Function
    End Class
    'Set the ReportViewer values and retrieve the report from the SSRS server into a pdf file on the client machine.
    ProposalRptViewer.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote
    ' Set the ReportViewer ReportServerCredentials from the MyReportServerCredentials Class.
    ' Note the credentials are for a domain account defined in the same domain that the SSRS server belongs to and one that has browser permission on the report folder.
    ProposalRptViewer.ServerReport.ReportServerCredentials = _
         New MyReportServerCredentials()
    ProposalRptViewer.ServerReport.ReportServerUrl = New Uri(System.Configuration.ConfigurationManager.AppSettings(Web.[Global].CfgKeyReportServerURL))
    ProposalRptViewer.ServerReport.ReportPath = System.Configuration.ConfigurationManager.AppSettings(Web.[Global].CfgKeyReportPathProposal)
    ProposalRptViewer.ShowCredentialPrompts = False     ' disable prompting for data source credentials
    Dim paramList As New Generic.List(Of ReportParameter)
    Dim pInfo As ReportParameterInfoCollection
    pInfo = ProposalRptViewer.ServerReport.GetParameters()
    paramList.Add(New ReportParameter("ProposalID", ProposalID, True))paramList.Add(New ReportParameter("Entity", Entity, True))
    paramList.Add(New ReportParameter("intRatesPage", intRatesPage1, True))
    ProposalRptViewer.ServerReport.SetParameters(paramList)
    ' Process and render the report
    ProposalRptViewer.ServerReport.Refresh()
    Dim mimeType As String = Nothing
    Dim encoding As String = Nothing
    Dim streams As String() = Nothing
    Dim extension As String = Nothing
    Dim warnings As Microsoft.Reporting.WebForms.Warning() = Nothing
    Dim returnValue As Byte()
    ' Render the proposal Rate Page 1 report to a Byte Array output in pdf file format.
    returnValue = ProposalRptViewer.ServerReport.Render("PDF", Nothing, mimeType, encoding, extension, streams, warnings)
    An error only occurs for web server not in the domain of SSRS Server:
    The request failed with HTTP status 401: Unauthorized.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
    Exception Details: System.Net.WebException: The request failed with HTTP status 401: Unauthorized.
    Source Error:
    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack
    trace below.
    Stack Trace:
    [WebException: The request failed with HTTP status 401: Unauthorized.]
       Microsoft.SqlServer.ReportingServices2005.Execution.RSExecutionConnection.GetSecureMethods() +236
       Microsoft.SqlServer.ReportingServices2005.Execution.RSExecutionConnection.IsSecureMethod(String methodname) +58
       Microsoft.SqlServer.ReportingServices2005.Execution.RSExecutionConnection.SetConnectionSSLForMethod(String methodname) +16
       Microsoft.SqlServer.ReportingServices2005.Execution.RSExecutionConnection.LoadReport(String Report, String HistoryID) +226
       Microsoft.Reporting.WebForms.ServerReport.GetExecutionInfo() +192
       Microsoft.Reporting.WebForms.ServerReport.SetParameters(IEnumerable`1 parameters) +136
       DeltaRater.Web.ViewRates.btnCreateProposal_Click(Object sender, EventArgs e) in C:\alex\~~_____Rapid_Rater\SourceDir_VS2008_Jan17_2014\DRR\ViewRates.aspx.vb:911
       System.Web.UI.WebControls.Button.OnClick(EventArgs e) +115
       System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +140
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +29
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2981
    Version Information: Microsoft .NET Framework Version:2.0.50727.8009; ASP.NET Version:2.0.50727.8010

    I got the answer to my question by following suggestions by Irb on another technical forum.
    From web server (not on same domain), I was passing credentials of a domain account on the SSRS server. Irb suggested I create a local account on the SSRS server and pass those credentials. I tried this but got the same results.
    This approach worked for web server in SSRS domain, but failed with 401 Unauthorized for web server outside the SSRS domain. Per suggestion for local account on SSRS server, I tried passing empty string "" as the domain via IReportServerCredentials.
    Again this works for web server in the same domain as SSRS. But I get the 401 Unauthorized error when the web server is outside the domain. In testing and checking similar posts, I discovered an additional piece was required for the report request to work
    across domains. The default user did not have authority to send the request and/or receive the report. Adding the following in <system.web> section of web.config file was needed.
    <identity impersonate="true" userName="localwindowsuser" password="#########"/>          where "localwindowsuser" is a windows user defined on the web server.
    I never needed this extra piece when the web server ran in the same domain as the SSRS server. I thank Irb for making me go through the details of additional tests because that is how I stumbled across an identity comment and ultimately got things working.

  • SQL Server Reporting Service 2008 R2 - The request failed with HTTP status 401: Unauthorized.

    I got the error "The request failed with HTTP status 401: Unauthorized." when I call the Reporting Service Web Service.
    The code is very simple:
    // Initialise the reporting service Web Service
    this.RSWebService = new ReportingService2010();
    // Pass windos authentication credentials to Web Service
    this.RSWebService.Credentials = System.Net.CredentialCache.DefaultCredentials;
    // List children
    List<CatalogItem> reports = this.RSWebService.ListChildren(folder, false).ToList();
    The SQL Server is installed on a different machine (say server A) from the Web server (say server B). We are using Windows Server 2003.
    The code work fine for all the scenario below:
    i) Run locally (XP) to call the web service on the sql server
    ii) Provide the Network Credentials with the username, password, and domain when calling the web service
    iii) If the web server and sql server is using same server (i.e. not distributed)
    I'm using windows authentication and impersonation. Any idea?

    Hi Raymond,
    If I understand correctly, the issue only happens in the environment that the web server is different with the SQL Server Reporting Services server. This means the web server is a remote server of the Report Server. Windows Integrated authentication is used
    in this case. When running the web page, the 401 error occurs.
    If so, it is actually a double hop issue. The double-hop problem will usually only be an issue to those of you who write some sort of web-based code (a web application or web service) that uses impersonation.
    To fix the issue, we can configure kerberos authentication for the web application and the SQL Server Reporting Services.
    Below is a great article that has delivered many solutions to fix the issue you met:
    http://odetocode.com/articles/216.aspx
    Additionally, you can read the following article to know more about double-hop:
    http://blogs.technet.com/b/askds/archive/2008/06/13/understanding-kerberos-double-hop.aspx
    http://blogs.msdn.com/b/knowledgecast/archive/2007/01/31/the-double-hop-problem.aspx
    If you have any more questions, please feel free to ask.
    Thanks,
    Jin Chen
    Jin Chen - MSFT
    Thanks Jin. I believe this is the cause of the problem as well.
    I tried to register the SPN but unfortunately it still doesn't work. I'm not sure whether I'm using the correct SPN name.
    I have 3 reporting server instance on the SQL box. So the Web Service URL is like
    http://Server:80/VirtualDirectoryDev,
    http://Server:80/VirtualDirectoryTest  and
    http://Server:80/VirtualDirectoryStaging .
    What's the SPN I need to register?
    I tried
    Setspn -a http/Server:80/VirtualDirectoryDev domain\account
    and
    Setspn -a http/aerver:80 domain\account.
    But both of them are not working :(

  • Problems connecting to SSRS using IReportServerCredentials, the request failed with http status 401: unauthorized

    We have a hosted SSRS server and we access it's reports using the reportviewer in an ASP.net application.
    We are getting the error: The request failed with HTTP status 401: Unauthorized. When trying to run one of the reports. I have confirmed that the login details work when logging into the report manager page directly.
    I have implemented an instance of IReportServerCredentials in a separate class (below) and I call it from the page before it tries to access the report. I'm not sure if this is all I need but can't seem to find any other info.
    I have managed to gain access connecting to the external server from my PC and accessed the report, but when I promote the code to production and run it from there on my local PC I get the unauthorized message again: the request failed with http status
    401: unauthorized
    The class:
    [Serializable]
    public sealed class MyReportServerCredentials :
    IReportServerCredentials
    public WindowsIdentity ImpersonationUser
    get
    // Use the default Windows user. Credentials will be
    // provided by the NetworkCredentials property.
    return null;
    public ICredentials NetworkCredentials
    get
    // Read the user information from the Web.config file.
    // By reading the information on demand instead of
    // storing it, the credentials will not be stored in
    // session, reducing the vulnerable surface area to the
    // Web.config file, which can be secured with an ACL.
    // User name
    string userName =
    ConfigurationManager.AppSettings
    ["MyReportViewerUser"];
    if (string.IsNullOrEmpty(userName))
    throw new Exception(
    "Missing user name from web.config file");
    // Password
    string password =
    ConfigurationManager.AppSettings
    ["MyReportViewerPassword"];
    if (string.IsNullOrEmpty(password))
    throw new Exception(
    "Missing password from web.config file");
    // Domain
    string domain =
    ConfigurationManager.AppSettings
    ["MyReportViewerDomain"];
    return new NetworkCredential(userName, password);
    public bool GetFormsCredentials(out Cookie authCookie,
    out string userName, out string password,
    out string authority)
    authCookie = null;
    userName = null;
    password = null;
    authority = null;
    // Not using form credentials
    return false;
    The call to the class, just before the report is run:
    if (GetConnection.GetConnectionString().ToString().Contains("IP of external server removed"))
    invoiceviewer.ServerReport.ReportServerCredentials = new MyReportServerCredentials();
    We have tried so many things here, we don't even care whether the server authenticates or not but it appears to be as standard. Our hosting company has also drawn a blank and changed so many settings to no ava

    Hi Nasa1999,
    According to your description, you are getting the error: The request failed with HTTP status 401: Unauthorized when you access the report using the ReportViewer in an ASP.net application.
    Regarding the 401 error, it could cause by the Service Principal Name(SPN) for the account the Reporting Services is running under hasn’t been registered when the Reporting Services is configured to use Kerberos authentication. So in your scenario,
    please check if you are using Kerberos authentication. If that is a case, please make sure SPN is configured correctly. For more information, please refer to the similar thread:
    The request failed with HTTP status 401: Unauthorized. in SSRS.
    If issue persists, please check the Reporting Service error log (default location: %programfiles%\Microsoft SQL Server\<SQL Server Instance>\Reporting Services\LogFiles) around the time that the error message thrown out.
    If you have any question, please feel free to ask.
    Best regards,
    Qiuyun Yu
    Qiuyun Yu
    TechNet Community Support

  • SSRS 2012 - The request failed with HTTP status 401: Unauthorized.

    I have SSRS Reporting Services 2012 load balanced on two servers. 
    Both servers are running Windows Server 2012 R2.
    I have a Web Application that renders reports by utilizing this SSRS Reporting Services 2012. 
    When the application generates a report using load balancing I get error the message, “The request failed with HTTP status 401: Unauthorized.”
    However, using only one reporting server, the application is able to render the report just fine. 
    It seems that when the requests are shared between the servers the problem occurs.
    One solution is to configure Load Balancing with “Source IP” persistence. 
    This seems to work.  I believe this is a “sticky” session. 
    With this Load Balancing configuration, the application can render the report just fine. 
    (However, I have not done complete testing.)
    The problem occurs when calling the service ListChildren(string, bool ) on SSRS. 
    I have been researching online.  I tried modifying the registry on the servers based on online articles (see below.)
    Here are some articles I have looked at.
    http://msdn.microsoft.com/en-us/library/cc281307(v=sql.110).aspx
    http://blogs.msdn.com/b/lukaszp/archive/2008/07/18/reporting-services-http-401-unauthorized-host-headers-require-your-attention.aspx
    http://blogs.msdn.com/b/lukaszp/archive/2008/07/18/reporting-services-http-401-unauthorized-host-headers-require-your-attention.aspx
    Is there a better solution?  Will Load Balancing with “Source IP” persistence be an acceptable solution?  Is there a patch needed for the servers or SSRS?  Please let me know.

    Hi GoGladiator,
    Generally, "The request failed with HTTP status 401: Unauthorized" occurs when
    The service account used to connect to the Report Server is not authorized.
    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.
    So, to fix this issue, we can refer to the follow steps:
    Make sure the user is able to connect to the Report Server.
    If using Kerberos authentication, please make sure SPN is configured correctly. If using Kerberos authentication, please make sure SPN is configured correctly.
    For more information about Kerberos Authentication and how to register SPN for a report server in Reporting Services, please see the articles below:
    Configure Windows Authentication on the Report Server
    Register a Service Principal Name (SPN) for a Report Server
    Hope this helps.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • SOAP Asynch Message Giving HTTP 401 Unauthorized error

    Hi experts,
    <Br>
    We are sending ORDERS IDOC Asynchronously from ECC To XI and XI is sending it to Vendor using SOAP.
    This interface was working OK and now we had HTTP 401 error. Checked URL,Username and password to the Vendor. It looks OK. It is working OK if I try it in browser.
    </br>
    <Br>
    I tried to refresh the object by changing values and reactivating,did cache refresh..Still didn't work.When I try to check for the problem found J2EE_GUEST user was locked.Same was unlocked and tried again.
    </BR>
    <BR>
    This IDOC is requesting for acknowledgement( trying to suppress ack by running IDX_NOALE).
    But now I need to reprocess these failed messages.I was trying in different ways and it is not going thru.
    Any pointers are really appreciated.
    </BR>
    Adapter Engine Log is as follows:
    <BR>
    2009-10-27 16:37:30 Success The message was successfully retrieved from the receive queue.
    <BR>
    2009-10-27 16:37:30 Success The message status set to DLNG.
    <BR>
    2009-10-27 16:37:30 Success Delivering to channel: CC_ORDERS05_TO_XYZ_SOAP
    <BR>
    2009-10-27 16:37:30 Success MP: Entering module processor
    <BR>
    2009-10-27 16:37:30 Success MP: Processing local module localejbs/sap.com/com.sap.aii.af.soapadapter/XISOAPAdapterBean
    <BR>2009-10-27 16:37:30 Success SOAP: request message entering the adapter with user J2EE_GUEST
    <BR>2009-10-27 16:37:30 Error Exception caught by adapter framework: SOAP: response message contains an error <BR>XIAdapter/HTTP/ADAPTER.HTTP_EXCEPTION - HTTP 401 Unauthorized
    <BR>2009-10-27 16:37:30 Success SOAP: completed the processing
    <BR>2009-10-27 16:37:30 Error SOAP: response message contains an error XIAdapter/HTTP/ADAPTER.HTTP_EXCEPTION - <BR>HTTP 401 Unauthorized
    <BR>2009-10-27 16:37:30 Success SOAP: sending a delivery error ack ...
    <BR>2009-10-27 16:37:30 Success SOAP: sent a delivery error ack
    <BR>2009-10-27 16:37:30 Success Acknowledgement creation triggered for type: SystemErrorAck
    <BR>2009-10-27 16:37:30 Success Acknowledgement creation triggered for type: AckNotSupported
    <BR>2009-10-27 16:37:30 Error MP: Exception caught with cause com.sap.aii.af.ra.ms.api.RecoverableException: SOAP: <BR>response message contains an error XIAdapter/HTTP/ADAPTER.HTTP_EXCEPTION - HTTP 401 Unauthorized
    <BR>2009-10-27 16:37:30 Success Acknowledgement sent successfully for type: SystemErrorAck
    <BR>2009-10-27 16:37:30 Success Acknowledgement sent successfully for type: AckNotSupported
    <BR>2009-10-27 16:37:30 Error Delivery of the message to the application using connection SOAP_http://sap.com/xi/XI/System <BR>failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: SOAP: response message contains an error <BR>XIAdapter/HTTP/ADAPTER.HTTP_EXCEPTION - HTTP 401 Unauthorized.
    <BR>2009-10-27 16:37:30 Error The message status set to NDLV.
    <BR>
    <BR>Regards,
    <BR>Ramesh
    Edited by: RameshK99 on Oct 28, 2009 1:57 AM

    Can you run a sniffer tool & see the actual reason for 401 unauthorized error? 6172 weblog: Troubleshooting SOAP, HTTP and Mail Adapter Scenarios with TCPGateway by Stefan Grube...
    Generally, 401 unauthorized is when the target system rejects the request...  Also, What type of authentication does the target webservice have.?? B'cos i ran into a similar problem with Ms-Webservice. (they were using NTLM authentication). It works from a browser but not from PI. So we installed SOAP-AXIS adapter to support NTLM based authentication.
    Regards,
    Siva Maranani

Maybe you are looking for