0

Using MVC5 with Identity 2.0, I have a created a user in a database using the register option. Now a record for this user is stored in table AspNetUsers.

I can now create a simple Windows Forms application that will accept username and password. But I am not sure how to authenticate the same user created earlier via the MVC website?

Thanks.

LJNielsenDk
  • 1,414
  • 1
  • 16
  • 32
ary
  • 939
  • 2
  • 13
  • 32
  • You would create the win form the same way that you would when you start / create a new project whether it's Web, Windows, Console...etc... then you would want to read up on how to use `PrincipalContext` as well as how to write a simple query that would execute against the username / password or however you have the information stored ..? then check against the logged in user using `PrincipalContext` – MethodMan Jan 13 '15 at 22:00
  • Thanks MethodMan. I am going to read PrincipalContext . My main problem is I need to do Hashing the same way asp.net mvc 5 identity is doing. I can of course create windows forms application. – ary Jan 13 '15 at 22:15
  • MethodMan : So looks like PrincipalContext is to check server credentials. I need to basically match password strings. I just need to match hashed password that is stored in database table with password on windows application form to make sure if they are same. Thanks. – ary Jan 13 '15 at 22:26
  • that can be done using ActiveDirectory.. or if you have a SHA5 encryption on the database or how ever else the pass word is stored in the table you can write something simple that will compare the password there are plenty of examples on line however not knowing how you store the passwords makes it difficult to recommend something to you – MethodMan Jan 13 '15 at 22:52
  • MethodMan: That is main problem. I am quite not sure how MVC5 dose it by default. Looks like http://stackoverflow.com/questions/27909469/what-is-the-hash-logic-in-mvc-5-identity based on my other post at http://stackoverflow.com/questions/27909469/what-is-the-hash-logic-in-mvc-5-identity. But again now I am not sure how to take it from there. – ary Jan 14 '15 at 01:40

0 Answers0