?
Solved

Forms Authentication - Add User to Role

Posted on 2011-09-28
2
Medium Priority
?
362 Views
Last Modified: 2012-05-12
Using VS2010   ASP.NET with VB.NET Code

I'm developing a web site using ASP.NET that will use Forms Authentication to authenticate users.  

I have an existing back end database that has a table of users with user name and password along with a field that represents their "role" for the web site.  I cannot alter the back end database so what I'm trying to do is implement Forms Authentication with Roles without using the Membership or Roles API.

in the code for my Login page, I do the following

- User clicks the 'Login' button.
- Pass their username and password to a customer data object that runs a stored procedure to see if this matches the user table in the database.
- The data object returns "Yes" if the username and password is authenticated as well as the user's "role"
- Set the FormsAuthentication.SetAuthCookie to authenticate the users and they are transferred to the sites home page.

During this login process, how to I assign the "role" to the authenticated user?
0
Comment
Question by:tfewster500
[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
2 Comments
 
LVL 21

Accepted Solution

by:
Tapan Pattanaik earned 2000 total points
ID: 36719356
0
 

Author Comment

by:tfewster500
ID: 36815555
I've looked at these links and I believe they all refer to using the Membership or Roles API which I do not want to do at this point.

If there anyway to simply assign the role in the code behind?
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

770 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