Solved

automatically authorising a new user i have added to a role

Posted on 2012-03-25
4
317 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

737 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