Link to home
Start Free TrialLog in
Avatar of javierpdx
javierpdxFlag for United States of America

asked on

redirect user after login based on a AD Group membership

After a user is authenticated, I want to redirect a user to a certain webpage based on a AD group membership.  How can I do this?  The group membership string : "Student.Admit,"

I'm trying to do this:
if AuthenticateUser.UserGroupMemberships = "Student.Admit,"
                    Response.Redirect("Offer.aspx");

IntelliSense Error on line 7 below is "Cannot implicitly convert 'string' to bool.'"

 try
      {
     AuthenticateUser = 
     AD.AuthenticateUserGetADIdentityAttributesGetADGroupMemberships(this.textboxUserName.Text, this.textboxPassword.Text);

     if (AuthenticateUser.UserIsAuthenticated)        
     {           
     if AuthenticateUser.UserGroupMemberships = "Student.Admit,"
                    Response.Redirect("Offer.aspx");
     {         
     Session["UserGroupMemberships"] = AuthenticateUser.UserGroupMemberships;                  
     Response.Redirect("NextPage.aspx");
     }    }

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Shaun Kline
Shaun Kline
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of javierpdx

ASKER

I really appreciate the help.
Yes, the group does return the comma after "Student.Admit".
I got this to work as expected.