Options

Access NAV webservice from IIS site with given credentials ?

bastirbastir Member Posts: 27
edited 2012-06-16 in NAV Three Tier
Hi,

following situation:

Server1 : SQL-Server, Service-Tier, IIS
Server2: my local Device

I've developed a small asp.net website that takes some url parameters and passes them to the webserver.
The site is authenticating to the webservice via given/stored credentials, that are stored in the web.config or any other file.
It workes great locally on Server2 (my dev-environment), so I published the site to a new virtual site on Server1.

On Server2 I'm facing a "401 - Unauthorized" Error from the webservice. The website is displayed correct and gives me back the message via try/catch.

I've tried almost everything and googled really a lot, but cannot reach my aim, that the user can open the website as anonymous user and the website is communicating to the webserver via fixed credentials.

One of my tried method to provide the user/pwd is:
CredentialCache cache = new CredentialCache();
                cache.Add(new Uri(service.Url), // Web service URL
                           "NTLM",       // Kerberos or NTLM <= I used Negotiate, too
                           new NetworkCredential(pUser, pPassword, pDomain));
                
                service.Credentials = cache;

Have anybody faced such a problem again or has some codesnipped or tipps for configuring IIS correctly.

Comments

  • Options
    kinekine Member Posts: 12,562
    The problem could be SPNs... check it by DelegConfig v2 to be sure that it will work.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Options
    MrJackalMrJackal Member Posts: 29
    hi, did the spns resolve this problem ?
Sign In or Register to comment.