Solved

Forms Authentication - Add User to Role

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

830 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