如何创建asp.net身份安全标志值(IUserSecurityStampStore) [英] How to create a security stamp value for asp.net identity (IUserSecurityStampStore)

查看:442
本文介绍了如何创建asp.net身份安全标志值(IUserSecurityStampStore)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的MVC-5的应用程序,我要的创建安全戳值手动即可。当前实现身份团队似乎用一个GUID。

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.

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

时将其保存到自己创建一个新的GUID并使用它作为一个新的安全标志值或在本导致asp.net身份将来的实现的问题?结果
有没有让身份框架为我创造这样的邮票价值,使我的实现是保存以供将来变化的方法?

Is it save to create myself a new Guid and use it as a new security stamp value or may this lead to problems in future implementations of asp.net identity?
Is there a method to let the identity framework create such a stamp-value for me so that my implementation is save for future changes?

更新结果
我已经改变了quesion文字更准确地阐述什么,我一直在寻找。

Update
I have changed the quesion text to elaborate more exactly for what i was looking for.

推荐答案

出了身份实施的实体框架的文件,似乎它可以是任何随机值:

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

<一个href=\"https://msdn.microsoft.com/en-us/library/microsoft.aspnet.identity.entityframework.identityuser.securitystamp(v=vs.111).aspx\">IdentityUser.SecurityStamp物业

一个GUID似乎因此罚款及以下code应该是可靠的也asp.net身份的未来版本。

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

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

这篇关于如何创建asp.net身份安全标志值(IUserSecurityStampStore)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆