Wednesday 15 July 2015

ASP.NET MVC 5 Identity 2.0 & OWIN Two Factor Authentication by using existing DB -



ASP.NET MVC 5 Identity 2.0 & OWIN Two Factor Authentication by using existing DB -

i've started mvc after working on web forms 4 years. i've watched few videos explaining architecture/fundamentals , i'm able replicate few modules of old project mvc5 using ef6.

i've sql server db containing tables such albums/artists/titles/reviews , user table. able work first set of tables using ef6 fine including inserts/deletes. prev project had implemented custom web forms authentication using bcrypt storing details in user table , later doing validations , setting auth cookie.

user table has details such userid, pwhash, email, firstname, lastname. userid fk in reviews table , few others.

the implementation i'm hoping below:

1. login screen accepts credentials , validates existing user table. 2. if valid, move 2fa screen(email/sms). 3. if valid, allow access application.

most of tutorials how extend attributes such firstname/lastname not how utilize existing db. i'm planning utilize bcrypt/scrypt encrypt sensitive details.

i've gone through mvc 5 & asp.net identity - implementation confusion id doesn't have answers queries

i need starting point on how plug existing db instead of using dbcontext provided default

if app using ef code first can utilize existing schema , plug in own user. @ next illustration shows how can reuse existing user info , plug identity http://aspnet.codeplex.com/sourcecontrol/latest#samples/identity/custommembershipsample/readme.txt

you not have inherit identitydbcontext. can straight utilize dbcontext. in case have override onmodelcreating create users/ roles tables , mappings between tables.

asp.net asp.net-mvc owin two-factor-authentication

No comments:

Post a Comment