Solved

Forms Authentication - Add User to Role

Posted on 2011-09-28
2
350 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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

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