Custom Roles w/ Windows Authentication?

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default Custom Roles w/ Windows Authentication?

    I have a need to define roles at the web application level, but still use
    Windows Authentication. I want the application to authenticate the user from
    the network login. But I do not want to use Active Directory to define the
    role. Instead I was hoping for a simple mechanism to decide whether a user
    has read only or write permissions. Of course I could use Active Directory to
    maintain the roles, but I want to avoid this. So far I have been able to use
    the <authorization> section of web.config to decide which users can log in.
    The
    User.IsInRole("admin")
    statement looks for the "admin" role on Active Directory. I would like to
    redirect the IsInRole function somewhere else more local to the application
    if possible.

    Can this be done?

    Steve Kallal Guest

  2. Similar Questions and Discussions

    1. Form Authentication - Roles - Always returns to login screen
      I'm using forms authentication and I want to limit access to certain directories only to users with certain roles. I have the following code...
    2. Custom Login Form for Windows Authentication?
      Hello: I need to have a custom login form page for a site with Windows Authentication and internally i make the 'authentication windows process'....
    3. Forms Authentication based on roles.
      HI, I have the following problem. I am making a portal of DJs. The djs must have a Menu, the administrator another menu. I created 2 directories...
    4. Forms Authentication with roles from table
      Hi, This is really driving me crazy... I'm working on a web application with different functionality for users in different roles. These...
    5. Custom Windows Authentication Principal?
      Ok here's the situation, I have several intranet applications at this company that use windows authentication. Now when people open the...
  3. #2

    Default Re: Custom Roles w/ Windows Authentication?

    Sure, there are a bunch of possible approaches to this.

    The basic thing to consider is where your custom roles come from. For
    example, do you want to store them in SQL, AD, XML, etc. Also, you need to
    decide if your custom roles will be mapped based just on user identity or
    also based on AD group membership.

    Microsoft provides a very interesting API for doing application level
    role-based security with great AD integration that you should seriously look
    at for this.

    If you go with a custom route, the mechanics of it are that you will replace
    the WindowsPrincipal in the Context.User property with some custom
    IPrincipal class that contains your own roles that are mapped in based on
    the data you get from the WindowPrincipal that ASP.NET provides you. You
    would hook this in either with an HttpModule or with a global.asax event
    handler.

    I hope this helps.

    Joe K.

    "Steve Kallal" <SteveKallal@discussions.microsoft.com> wrote in message
    news:E9D2A111-E3B6-4126-9C34-22D62C673981@microsoft.com...
    >I have a need to define roles at the web application level, but still use
    > Windows Authentication. I want the application to authenticate the user
    > from
    > the network login. But I do not want to use Active Directory to define the
    > role. Instead I was hoping for a simple mechanism to decide whether a user
    > has read only or write permissions. Of course I could use Active Directory
    > to
    > maintain the roles, but I want to avoid this. So far I have been able to
    > use
    > the <authorization> section of web.config to decide which users can log
    > in.
    > The
    > User.IsInRole("admin")
    > statement looks for the "admin" role on Active Directory. I would like to
    > redirect the IsInRole function somewhere else more local to the
    > application
    > if possible.
    >
    > Can this be done?
    >

    Joe Kaplan \(MVP - ADSI\) Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139