RE: ActiveDirectory and user page Access
- From: Alex. O. Koranteng <AlexK@xxxxxxxxxxxxxxxx>
- Date: Mon, 1 Dec 2008 15:29:01 -0800
I have been looking at the options for configuring AD membership and looks
like for the role management I found this link:
http://msdn.microsoft.com/en-us/library/ms998336.aspx. It looks very detailed
and I am not how to get around this. Can I just enabled the role manager in
the web.config file and go from there. I used this web.config below and
created a demo app to retrieve the role of the logged on and was not
successful.Any hints
""Hongye Sun [MSFT]"" wrote:
Thanks for your reply, Alex..
Here are my answers:
(1)What does the CN=Users,DC=testdomain1,DC=tesThis is the DistinguishedName in ADsPath. It is required if Kerberos
t,DC=com" mean and do I have to use these attributes
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 logincontrols
and still user the membership classThe 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 thatDo you mean you want the sample code of validate the group or role that the
the logged in user belongs to. It appears to be similar to validate user
syntax but I am not sure.
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.
- Follow-Ups:
- RE: ActiveDirectory and user page Access
- From: "Hongye Sun [MSFT]"
- RE: ActiveDirectory and user page Access
- References:
- RE: ActiveDirectory and user page Access
- From: "Hongye Sun [MSFT]"
- RE: ActiveDirectory and user page Access
- Prev by Date: Re: Error messages from custom tool
- Next by Date: Print a single (existing) PDF page
- Previous by thread: RE: ActiveDirectory and user page Access
- Next by thread: RE: ActiveDirectory and user page Access
- Index(es):
Relevant Pages
|
Loading