Solved

Forms Authentication - Add User to Role

Posted on 2011-09-28
2
348 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
2 Comments
 
LVL 21

Accepted Solution

by:
Tapan Pattanaik earned 500 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

705 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