在ASPNET身份2.0禁用用户 [英] Disable User in ASPNET identity 2.0

查看:143
本文介绍了在ASPNET身份2.0禁用用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要寻找一种方法来禁用的,而不是从系统中删除它们的用户,这是保持相关的数据的数据完整性。但似乎ASPNET身份不仅提供删除Acccount。

I am looking for a way to disable the user instead of deleting them from the system, this is to keep the data integrity of the related data. But seems ASPNET identity only offers Delete Acccount.

有一个新的锁定功能,但它似乎闭锁可以控制禁用的用户,但是只有特定数量的不正确的密码尝试后出锁定用户。

There is a new Lockout feature, but it seems to lockout can be controlled to disable user, but only lock the user out after certain number of incorrect password tries.

任何其他的选择吗?

推荐答案

您需要介绍一下你自己的旗帜到定制IdentityUser派生类,并实现/执行自己的逻辑关于启用/禁用和preventing用户如果从禁止登录。

You would need to introduce your own flag into a custom IdentityUser-derived class and implement/enforce your own logic about enable/disable and preventing the user from logging in if disabled.

这篇关于在ASPNET身份2.0禁用用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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