Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Manually Insert into Identity Framework AspNetUsers Table

I am implementing a new Authorization API with Identity Framework. However, We have our users table and I am trying to add the users information into the AspNetUsers table.

Quetions

  1. How to generate the GUID
  2. How to convert current plain-text password to the PasswordHash
  3. How/What to add data in the SecurityStamp column.
like image 646
Mirrh Avatar asked Apr 12 '16 20:04

Mirrh


1 Answers

  1. You can generate Guid with Guid.NewGuid().ToString()
  2. You can use PasswordHasher int UserManager like this UserManager.PasswordHasher.HashPassword(password)
  3. You insert any random string or a Guid.NewGuid().ToString() in SecurityStamp. It will automatically will be updated everytime user log-ins to system.
like image 199
Shoaib Shakeel Avatar answered Nov 11 '22 17:11

Shoaib Shakeel