Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Test C# API Controller with Windows Authentication at home

Options
  • 04-01-2017 8:24pm
    #1
    Registered Users 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