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

  • Home
  • SEARCH
  • 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 8186855
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T02:21:56+00:00 2026-06-07T02:21:56+00:00

I am using Windows authentication on a website but want to have levels of

  • 0

I am using Windows authentication on a website but want to have levels of access. Currently, I am using the [Authorize(Users = “userA”)] syntax.

However, with upwards of twenty Windows accounts accessing a site, I don’t want to have to hard-code in twenty users with each Authorize statement. What’s more, some of the users need to have different access than others. I thought of having a list of users that a CustomAuthorizationAttribute iterates through to see if the desired user is among them.

Basically, I’m trying to get roles without using Forms authentication.

What is the most effective, most simple way of doing this?

  • 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-07T02:21:58+00:00Added an answer on June 7, 2026 at 2:21 am

    Your answer lies within the ActiveDirectory domain. Since you are using MVC 3 you should have access to the following namespace “Directory Services Account Management”:

    http://msdn.microsoft.com/en-us/library/system.directoryservices.accountmanagement.aspx

    You can see this article for describing the whole process underneath, it provides sample code for you to use immediately out of the box:

    http://msdn.microsoft.com/en-us/magazine/cc135979.aspx

    Forwarning:
    You will also have to establish an LDAP connection string. LDAP is a protocol used for retrieving that information from the secured windows database.

    http://technet.microsoft.com/en-us/library/aa996205(v=exchg.65).aspx

    To see the code being used in action:

    http://www.willasrari.com/blog/query-active-directory-users-using-c/000133.aspx

    I’ve done something similar to this in a .NET 3.5 environment using IIS 7.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASP.Net application where I am using Windows authentication to deny access
I have an internal website that is using integrated windows authentication and this website
I have an ASP.NET website set up using Windows authentication. Each time I open
I am using windows authentication without impersonation on my company's intranet website with IIS7.
If I am using Windows Authentication in an ASP.NET app, and I want to
I am using IIS V5.1. Integrated windows authentication I have a following web config:
I am currently using a netTcpBinding with Windows authentication (program written in C#). I
I'm trying to access an internal website that requires windows authentication. I've tried going
I have the following scenario where I’m planning in using windows authentication. 1.1) I
I have an ASP.Net application that is using Windows Authentication and I have specified

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.