c# - Using SimpleMembership MVC4 with existing database -
i working mvc4 application , existing database. want use default login , register defined @ simplemembership mvc4.
i using table employee information like, employeid, employename, password, email... @ simplemembershipinitializer
changed
websecurity.initializedatabaseconnection("defaultconnection", "userprofile", "userid", "username", autocreatetables: true);
to own :
websecurity.initializedatabaseconnection("hrcontext", "employee", "employeeid", "employename", autocreatetables: true);
and changed accountcontroller
in vain
i want use database default register/ login methods.i read several topics, none of them give me need.
you can't change tables , expect work variety of reasons. in fact, unless you're very lucky, chances won't work @ because simplemembership has hard coded password hashing algorithm, , can't override it. unless original web app used identical hashing alogorithm (assuming used hash @ all) isn't going recognize users password.
more importantly, however, chances employee table not correct schema simplemembership expecting. again, hard coded in simplemembership , not can change. simplemembership try create own tables , ignore password , other fields want (other username , userid, assuming userid in correct format)
simplemembership provide flexible way extend default tables, @ mercy of it's schema basic credential portion of it.
if need use existing system, have use legacy membership system , create custom membership provider. there literally hundreds if not thousands of questions , answers on stack overflow on how this.
Comments
Post a Comment