How can I configure membership provider to insert data on my own database
views:
121answers:
2
+2
A:
Write a custom Membership Provider to use your custom database (if you want to use a completely different database schema) or follow the steps here:
Justin Niessner
2010-04-15 14:28:13
This is solved my problem: http://www.integratedwebsystems.com/2010/02/how-to-setup-and-configure-mysql-membership-provider-6-2-2-porting-to-mono-part-2-of-3/#
Ognjen
2010-04-15 19:10:21
A:
You can create a custom MembershipProvider to deal with a custom authentication system. You have to implement a bunch of methods. Here is an example
public class DreemMembershipProvider : MembershipProvider
{
...
public override MembershipUser CreateUser(string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved, object providerUserKey, out MembershipCreateStatus status)
{
//your code to insert a user in the db.
}
public override bool ValidateUser(string username, string password)
{
//your code to check the user and pass against your db
}
...
}
finally you have to set your app to use your membership provider -> in the web.config
Svetlozar Angelov
2010-04-15 14:32:34
I use mySql database and Asp.net mvc with automatic generated account controller and i have store info about user in mylqs database
Ognjen
2010-04-15 14:38:16
I am not aware of Mysql Membership providers for asp.net (that doesn't mean there isn't one), but a solution would be code your custom authentication system. You just need to write the implementation of the MemberShipProvider methods for writing and reading from the db
Svetlozar Angelov
2010-04-15 14:42:10
When you change the membership provider to be your own custom one, all methods from the "generated" account controller will use the methods in your custom MemberShip Provider. I think this is what you want...
Svetlozar Angelov
2010-04-15 14:43:56
when i for example register one user he showed on ainimdstrative tools but not in mysql database
Ognjen
2010-04-15 14:46:39