Last post Feb 06, 2012 12:41 PM by bbcompent1
Feb 03, 2012 12:53 PM|geeknout|LINK
I'm using forms authentication with ActiveDirectoryMembershipProvider to authenticate on my intraneet site, I'd like to be able to show panels based on group membership, but am not able to determine if the user is in the group or not. I can do this in windows
authentication fairly easily, but didn't want to do it that way.
IS there a way to determine if a user is in a group with the ActiveDirectoryMembershipProvider?
Feb 03, 2012 01:08 PM|bbcompent1|LINK
Maybe this link will help? You have to iterate through each group and can simply write the result to an arraylist which you can toss into a label as text.
Feb 06, 2012 12:18 PM|geeknout|LINK
Thanks for the reply, but I worked all weekend and wasn't able to get that to work. Any other thoughts?
Feb 06, 2012 12:41 PM|bbcompent1|LINK
Do you have any code you can show me? Here is a rough example of something you might be able to use (using User.IsInRole and specify the AD Group name in this fashion):
private void Page_Load(object sender, System.EventArgs e)
string userName = this.User.Identity.Name; if (
Write(userName + " is a member of the Portal Administrators group.");
Write(userName + " is not a member of the Portal