RE: ActiveDirectory and user page Access

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Thanks a lot which feature do I use for configuring roles using Active
directory membershiop provider. You mentioned WindowsRoletokenprovider, but I
am not if that is the one to use. Can you provide me documentation on how to.
I know how to use the Web site admin tool but I believe that is for using
Sqlmembership provider. Correect me iuf I am wrong
Alex

""Hongye Sun [MSFT]"" wrote:

Thanks for your reply, Alex.

Here are my answers:

(1)What does the CN=Users,DC=testdomain1,DC=tes
t,DC=com" mean and do I have to use these attributes
This is the DistinguishedName in ADsPath. It is required if Kerberos
authentication is required in your AD. This is detailed documented at
http://msdn.microsoft.com/en-us/library/aa746384.aspx. You'd better to use
it, because it works in any case of authentication.

(2)Is Is it possible to use text box controls instead of the login
controls
and still user the membership class
The answer is yes. Please use "Membership.ValidateUser(userName.Text,
password.Text)" to do authentication.
Here is sample code for doing the same job with
ActiveDirectoryMembershipProvider. Please follow the "Using the
ActiveDirectoryMembershipProvider" section:
http://msdn.microsoft.com/en-us/library/ms998347.aspx#paght000022_usingtheac
tivedirectorymembershipprovider

(3) Can you give a line of line that will validate the group or role that
the logged in user belongs to. It appears to be similar to validate user
syntax but I am not sure.
Do you mean you want the sample code of validate the group or role that the
logged in user belongs to?
Usually, we use the method: "Roles.IsUserInRole(userName, roleName)" to do
it, which gets a value indicating whether the specified user is in the
specified role. It is documented at
http://msdn.microsoft.com/en-us/library/bz1zy88e.aspx.
Another method is "Roles.GetRolesForUser(userName)", which gets a list of
the roles that a user is in. It is documented at
http://msdn.microsoft.com/en-us/library/8h930x07.aspx.
Another alternative is "User.IsInRole(roleName)". The User is from
System.Web.HttpContext.Current.User. It is documented at
http://msdn.microsoft.com/en-us/library/system.security.principal.iprincipal
.isinrole.aspx.

The roles and groups can be provided by SqlRoleProvider, or
WindowsTokenRoleProvider. That depends on your configuration in web.config.
Again, for SqlRoleProvider, the best sample I ever found is the
step-by-step instruction in Scott Gu's blog in my initial reply.
For WindowsTokenRoleProvider, similiar to SqlRoleProvider. The sample
configuration code is at
http://msdn.microsoft.com/en-us/library/system.web.security.windowstokenrole
provider.aspx.

We understand that there are so many concepts and configurations that you
need to know when implementing this feature. So please feel free to let us
know your questions and it is always our pleasure to work them with you.

Have a nice day!

Regards,
Hongye Sun (hongyes@xxxxxxxxxxxxxxxxxxxx, remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@xxxxxxxxxxxxxx

This posting is provided "AS IS" with no warranties, and confers no rights.









.



Relevant Pages

  • RE: Password reset configuration with ActiveDirectoryMembershipPro
    ... "Attribute schema mappings for bad password answer tracking must be ... ActiveDirectoryMembershipProvider attributes. ... I think you may also have a check in your configuration file to see whether ... Microsoft MSDN Online Support Lead ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: hardware training - storageWorks
    ... Click on the 'Technical documentation' link. ... is the SWCC VMS Agent ... Configuration is easy using SWCC as is replacement of failed devices ... RAID 5 set on the controller - the SWCC ...
    (comp.os.vms)
  • Re: Hmm, not understanding log4j properly :(
    ... > is actually looking to open this file for reading? ... the log4j system. ... As the documentation of the method (public static void ... The reaction has to be defined within the configuration ...
    (comp.lang.java.programmer)
  • [opensuse] Re: postfix: Name service error
    ... traditional Unix way"), ... does not take sysadmin tasks in account: ... of the myriads of XML configuration files. ... documentation for systems like HAL, D-BUS, or *Kit doesn't help ...
    (SuSE)
  • Re: ASP.NET 2.0 WindowsTokenRoleProvider Local Groups Broken
    ... I have to use a RoleProvider because of other needs in the application -- there's another library that leverages RolePrincipal for authorization. ... If I remove the MACHINE-NAME from the above configuration, Application_EndRequest is only called 1 time, without an authenticated identity. ... If I run with RoleManager enabled in ASP.NET (<roleManager ... RoleManager enalbed for the WindowsTokenRoleProvider, ...
    (microsoft.public.dotnet.framework.aspnet.security)