Options

Error 401 when trying to acces NAV 2013 Web Service

AntoineVAntoineV Member Posts: 3
edited 2014-12-11 in NAV Three Tier
Hi!

First of all, sorry if the question have already been posted, but I didn't find anything that could help on the forum.

I'm trying to access NAV 2013 Web service in a Visual Studio C# application for one of our customer.
Here is the setup of our servers :
- SQL Server : Server1
- NAV 2013 Tier Service Server : Server2. We used our active directory administrator account to start the service.

When I want to add a service reference to my project, an authentication window pop up and ask me for credentials.
Even if I provide the correct credentials (our active directory administrator account, the same service account used for NAV2013 tier service), this window pop up in loop and I can't do anything.
If I press cancel on this window, I got an error message that says : "The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Negotiate’" and HTTP 401 error.

I've tried to enter the web service URL in IE on my computer, a window asking for credentials opens (like in VS) and when I press ok, I got an HTTP 400 error.
When I do this on Server2, there is no problem and I can see all the page/codeunits that I've published.

I also tried to use the network account on Server2, but this time I get an SQL error on both computer, and I got a new entry in SQL Server log (ID 18456 : "Login failed for user Reason: Token-based server access validation failed").

Thanks for your help/answers!

Answers

  • Options
    vremeni4vremeni4 Member Posts: 323
    Hi,

    If you use a specific user to run NAV Server Service then you have to create a delegation as explained here
    http://msdn.microsoft.com/en-us/library/jj551742%28v=nav.71%29.aspx

    Also make sure that the user you use to run NAV Server Service has enough permissions as explained here:
    http://msdn.microsoft.com/en-us/library/hh166150%28v=nav.71%29.aspx

    This is only necessary if you use a dedicated user for NAV Server service.

    If you change the user to be Network Service it will work. This is probably the best way to start. Later you can use a dedicated user.

    I hope this helps.
    Thanks.
  • Options
    AntoineVAntoineV Member Posts: 3
    Hi,

    Thanks for your answer.
    Yesterday, I forgot to mention that I already tried to setup delegation (with the MSDN link) for the service account, but with no sucess.

    Today I tried again with the network service account as you said, and I found something in the SQL Server log : the event with the ID 18456 came with the message "Login failed for user Domain\ComputerName$".

    So I created this user in SQL security, gave him access to the NAV 2013 database, and now I can access my web service from my computer.

    I will try to setup delegation later, if it's working in this configuration, I'll procede like this for the moment.

    Again, thanks for your help!
Sign In or Register to comment.