Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.
Hi all, please see this major site announcement: https://www.boards.ie/discussion/2058427594/boards-ie-2026

Test C# API Controller with Windows Authentication at home

  • 04-01-2017 07:24PM
    #1
    Registered Users, Registered Users 2 Posts: 40


    Hi

    I am involved in a project which requires a SSO SPA Web application (Angular) that talks to a REST back-end (API controller). The problem is testing the Active Directory components of the project - more specifically Authentication.

    I went ahead and set up a domain controller (using Zentyal Community Server), and added my developer machine to the domain. So effectively, I can log into the workstation using the network credentials.

    So I did a quick test and did a Windows Authentication Web project in Visual Studio (MVC/API I think) and that works as expected, retrieving the network credentials and user groups from the DC via UserPrincipal. (The site is running in VS using IIS Express).

    The problem is configuring the site in IIS 7.0.

    I have done everything I could think off (according to Google) to configure IIS - from setting the site authentication to Windows only (no anonymous), to setting site/application pool/folder permissions to network user (which is created on DC), to ensuring that the host name (of the site) is set to the same domain as the DC (which is *.home.lan), but I keep on getting HTTP 401 Authentication failed. In fact, my Authorisation attributes doesn't even get triggered when listening in debugging mode.

    So I am about to pull every single last hair out of my head.

    If anyone can assist me in this matter, I'll greatly appreciate it.


Advertisement