scm0sml
asked on
automatically authorising a new user i have added to a role
Hi,
I'm just getting into roles and membership.
I have the code below which is on my registration page.
The users username is their email address.
Once the user has entered their information click register I want to save their details as I have done, add them to the relevant role and then re-direct them to the main menu of the private area.
The only bit I am missing below is how to "automatically" authorise them?
I'm just getting into roles and membership.
I have the code below which is on my registration page.
The users username is their email address.
Once the user has entered their information click register I want to save their details as I have done, add them to the relevant role and then re-direct them to the main menu of the private area.
The only bit I am missing below is how to "automatically" authorise them?
//we use the email as the username and give it customer membership
Roles.AddUserToRole(c.Email, "Registered Customer");
//need a step here to authorise the user automatically so they have access to the private area.
//????
//now we need to "log" the user in and re-direct to the customer main menu
Response.Redirect("ClientArea/CustomerMainMenu.aspx");
ASKER
I can't see anything in there that is doing what I'm after...
Basically after saving my new user to the database I want to authorise them.
They have been added to the role so I just need to say "right this user is now logged in"...?
Basically after saving my new user to the database I want to authorise them.
They have been added to the role so I just need to say "right this user is now logged in"...?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://www.asp.net/web-forms/tutorials/security/roles/role-based-authorization-cs