Solved

automatically authorising a new user i have added to a role

Posted on 2012-03-25
4
297 Views
Last Modified: 2012-08-13
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?
//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");

Open in new window

0
Comment
Question by:scm0sml
4 Comments
 
LVL 7

Expert Comment

by:Lalit Chandra
ID: 37763004
0
 

Author Comment

by:scm0sml
ID: 37770128
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"...?
0
 
LVL 16

Accepted Solution

by:
SriVaddadi earned 500 total points
ID: 37788443
call Membership.ValidateUser with username and password
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now