如何在MVC5中解密密码? [英] How to decrypt password in MVC5?

查看:81
本文介绍了如何在MVC5中解密密码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用MVC5,我知道如果用户忘记了密码,那么MVC会提供忘记密码和重置密码的功能。我的客户端服务器与Internet或邮件断开连接,它位于防火墙后面,因此我无法使用忘记密码,因为它可能会生成重置密码的链接,但无法将其邮寄给用户以方便密码重置。



我尝试过:



请建议是否有办法解密密码(让用户知道他是否忘记了密码),就像使用成员类的GetPassword方法一样,在asp.net成员资格中可用。

I am using MVC5, i know that if a user forgets his password, then MVC provides the feature of forgot password and reset password. My client server is disconnected from internet or mailing, it is behind the firewalls, so i cannot use forgot password, as it might generate a link to reset password, but cannot mail it to the user to facilitate the password reset.

What I have tried:

Please suggest if there is any way to decrypt the password(to let user know if he forgets his password) like how it was available in asp.net membership by simply using the GetPassword method of the membership classes.

推荐答案

首先,MVC根本没有身份验证功能,它只是一个网站的演示框架。如果您有密码等,那么您将使用不同的框架来实现,例如ASP.Net成员资格或身份。



至于问题,它取决于如何存储密码。如果它是散列的(这是默认值),则根本无法对其进行解密。如果您不想回复电子邮件,那么您可以随时使用自己的密码重置功能(用于散列密码),或密码解密页面(如果使用加密密码),谷歌asp.net membership重置密码了解更多详情,这些API都有详细记录。
First off MVC has no authentication feature at all, it's simply a presentation framework for websites. If you have passwords etc then you'll be using a different framework to implement that such as ASP.Net Membership or Identity.

As for the question, it depends on how the password is stored. If it is hashed (which is the default) then you can't decrypt it at all. If you don't want to reply on email then you can always right your own password reset feature (for hashed passwords), or password decrypt page if it is using encrypted password, google "asp.net membership reset password" for more details, these APIs are well documented.


这篇关于如何在MVC5中解密密码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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