How to create a security stamp value for asp.net identity (IUserSecurityStampStore)

后端 未结 3 1529
死守一世寂寞
死守一世寂寞 2021-02-18 16:56

In my MVC-5 application, I have to create security stamp values manually. The current implementation of the identity team seems to use a guid.

G         


        
3条回答
  •  青春惊慌失措
    2021-02-18 17:30

    Out of the documentation of the identity implementation for the entity-framework, it seems that it can be any random value:

    IdentityUser.SecurityStamp Property

    A guid seems therefore fine and the following code should be reliable also with future versions of asp.net identity.

    Guid.NewGuid().ToString("D")
    

提交回复
热议问题