Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7833761
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T12:52:53+00:00 2026-06-02T12:52:53+00:00

What are the high level steps to authenticate users of an ASP.NET MVC application

  • 0

What are the high level steps to authenticate users of an ASP.NET MVC application against Active Directory?

I presume something like:

  1. Modify web.config to use Windows authentication
  2. Configure web.config to use the ActiveDirectoryMembershipProvider
  3. Configure the web.config to use a custom RoleProvider that looks in AD

Does the above look sensible, and if so, where do I put the valid user detection logic?

In my case a valid user is someone on a specific AD domain.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T12:52:54+00:00Added an answer on June 2, 2026 at 12:52 pm

    Forms Authentication

    You can use the normal forms authentication to authenticate a user against an Active Directory, for that you just need you AD connection string:

    <connectionStrings>
      <add name="ADConn" connectionString="LDAP://YourConnection" />
    </connectionStrings>
    

    and add the Membership Provider to use this connection:

    <membership defaultProvider="ADMembership">
      <providers>
        <add name="ADMembership"
             type="System.Web.Security.ActiveDirectoryMembershipProvider,
                   System.Web,
                   Version=2.0.0.0, 
                   Culture=neutral,
                   PublicToken=b03f5f7f11d50a3a"
             connectionStringName="ADConn"
             connectionUsername="domain/user"
             connectionPassword="pwd" />
      </providers>
    </membership>
    

    you will need to use username@domain to successfully authenticate the user.

    Here is something to get you started

    • http://helios.ca/2009/05/04/aspnet-mvc-forms-authentication-with-active-directory/

    Windows Authentication

    If you start your project new, you can always select Intranet application from the template and all is taken care for you

    enter image description here

    If you want to do it manually, you need to change:

    1. Enable Windows Authentication
    2. Disable Anonymous authentication

    for detailed info on doing this on IIS7/8 and IISExpress:

    IIS 7 & IIS 8

    1. Open IIS Manager and navigate to your website.
    2. In Features View, double-click Authentication.
    3. On the Authentication page, select Windows authentication. If Windows
      authentication is not an option, you’ll need to make sure Windows authentication
      is installed on the server.

      To enable Windows authentication on Windows:
      a) In Control Panel open “Programs and Features”.
      b) Select “Turn Windows features on or off”.
      c) Navigate to Internet Information Services > World Wide Web Services > Security
      and make sure the Windows authentication node is checked.

      To enable Windows authentication on Windows Server:
      a) In Server Manager, select Web Server (IIS) and click Add Role Services
      b) Navigate to Web Server > Security
      and make sure the Windows authentication node is checked.

    4. In the Actions pane, click Enable to use Windows authentication.

    5. On the Authentication page, select Anonymous authentication.
    6. In the Actions pane, click Disable to disable anonymous authentication.

    IIS Express

    1. Right click on the project in Visual Studio and select Use IIS Express.
    2. Click on your project in the Solution Explorer to select the project.
    3. If the Properties pane is not open, open it (F4).
    4. In the Properties pane for your project:
      a) Set “Anonymous Authentication” to “Disabled”.
      b) Set “Windows Authentication” to “Enabled”.

    In your web.config have something like

    <system.web>
      <authentication mode="Windows" />
    
      <authorization>
        <deny users="?" />
      </authorization>
    </system.web>
    

    and that’s it!

    Now, when you want the user identity, just call

    @User.Identity.Name
    

    and this will show you the Domain\Username like for me :

    enter image description here

    Here is something to get you started

    • http://www.asp.net/mvc/tutorials/older-versions/security/authenticating-users-with-windows-authentication-cs
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to hear from you folks that have achieved a high-level of
High Level With StructureMap, Can I define a assembly scan rule that for an
The high level problem we're having is this. We've got Apache Wave installed and
I have a very high level of Inserts/Updates vs Reads let's say 99% Writes
I am writing a high-level MIPS assembler. I'm having trouble off the bat trying
Are there compilers for high-level languages (such as C) which can be targeted to
Are there any high-level, cross-platform, and abstracted (simple to use) widget toolkits for C
I find that many high level functions are missing in most well-known javascript libraries
Are there any high level language that don't support using C++ libraries?
This is for some high level Web/Rest tests of my whole system that are

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.