Groups | Blog | Home
all groups > asp.net security > june 2007 >

asp.net security : Forms Authentication - Active Directory


oriol.ardevol NO[at]SPAM gmail.com
6/11/2007 12:00:00 AM
Hi,

I have an asp.net 2.0 application with forms authentication. I am
authenticating the users to an Active Directory Server with
ActiveDirectoryMembershipProvider which works as expected and users
get authenticated.

What I am trying to do is to get also the role information from the
Active Directory Server with the groups where the users belong to.

Is there any way to achieve it ? Can it be done by enabling some
provider in the role manager section of the web.config file ?

any help will be appreciated, thx in advance,
ori
Alexey Smirnov
6/11/2007 3:38:33 AM
[quoted text, click to view]

You would need a role provider.

WindowsTokenRoleProvider for using Active Directory groups as roles
AuthorizationStoreProvider - for Windows 2003 and ADAM
SqlRoleProvider for storing roles in SQL Server

More about WindowsTokenRoleProvider
http://msdn2.microsoft.com/en-us/library/system.web.security.windowstokenroleprovider.aspx
Alexey Smirnov
6/11/2007 4:25:57 AM
[quoted text, click to view]

Ah, yes, Dominick and you were right, I've missed that you asked about
the Forms Authentication. Sorry!
Joe Kaplan
6/11/2007 9:37:51 AM
FYI, Ryan's LDAP-based AD/ADAM Role Provider is posted on Code Plex now in
case anyone wants it or wishes to contribute.

Joe K.

--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"
http://www.directoryprogramming.net
--
"Dominick Baier" <dbaier@pleasepleasenospam_leastprivilege.com> wrote in
message news:51eb3048119428c97a3e35d04cf0@news.microsoft.com...
[quoted text, click to view]

Dominick Baier
6/11/2007 10:50:23 AM
They are all not very helpful in your situation.

The WindowsTokenRoleProvider only works with windows auth - not forms.

Ryan an me have written an ActiveDirectoryRoleProvider - which seems to work
for most people...

i can send you the code if you are interested...


-----
Dominick Baier (http://www.leastprivilege.com)

Developing More Secure Microsoft ASP.NET 2.0 Applications (http://www.microsoft.com/mspress/books/9989.asp)

[quoted text, click to view]

oriol.ardevol NO[at]SPAM gmail.com
6/11/2007 11:06:18 AM
I had already tried those solutions.

WindowsTokenAuthenticationProvider does'nt works for Forms
Authentication as Dominick pointed, and I couldn't managed to get
AuthorizationStoreProvider to work (ended up getting some weird
COMException error which I already posted in this group last week)

Finally, I developed my own role provider which accesed the active
directory and got the role information.

Thanks for everything,
ori
AddThis Social Bookmark Button