简体   繁体   English

asp.net成员资格未发送登录提醒

[英]asp.net membership not sending login reminders

I'm using asp.net's built-in membership provider with security question-and-answer enabled for password recovery against a SQL Server 2005 db. 我正在使用asp.net的内置成员资格提供程序,并启用了安全性问答,以针对SQL Server 2005数据库恢复密码。 For some users, this works fine and they're able to receive their passwords. 对于某些用户而言,这可以正常工作,并且能够接收密码。 For others, and it's not clear what separates the two groups, the security answer is never properly processed. 对于其他人(不清楚将这两个组分开的原因),永远不会正确处理安全性答案。 It doesn't matter if the answer is correct or incorrect, the page merely reloads without confirming or denying the request. 答案是正确还是错误都没有关系,页面只是重新加载而不确认或拒绝请求。

As for events, VerifyingAnswer is being triggered, but not AnswerLookupError (if answer is incorrect) or SendingMail (if answer is correct). 至于事件,VerifyAnswer被触发,但不是AnswerLookupError(如果答案不正确)或SendingMail(如果答案正确)被触发。 I ran a SQL trace during one instance, and the aspnet_Membership_GetUserByName stored procedure is being called, but nothing else gets called after. 我在一个实例中运行了一个SQL跟踪,并且正在调用aspnet_Membership_GetUserByName存储过程,但此后没有其他任何调用。 I would expect that aspnet_Membership_GetPassword would be called, which passes the security answer as a parameter, but it isn't. 我希望会调用aspnet_Membership_GetPassword,它将安全性答案作为参数传递,但事实并非如此。

Update: I was able to resolve the issue. 更新:我能够解决问题。 In my case, I am catching the events and using email addresses from another source (ie. not the membership database) tied to the user making the request. 就我而言,我捕捉事件,并使用电子邮件地址从绑在发出请求的用户的另一来源(即不是会员数据库)。 The problem is that the PasswordRecovery control chokes if there is not an email address in the corresponding asp.net membership record, even though I'm not relying on it being there. 问题是,PasswordRecovery控件扼流圈如果没有在相应的asp.net成员记录的电子邮件地址,即使我不依靠它在那里。

I think the reason I didn't realize this before is because I would've expected that requirement to trigger an issue immediately after entering the user name instead of additionally prompting the user to answer the security question. 我想之前我没有意识到这一点的原因是因为我会一直预期要求输入用户名,而不是另外提示用户回答出安全问题后立即触发的问题。 I fixed the issue by sticking an email address in every membership record. 我通过在每个会员记录中粘贴一个电子邮件地址来解决此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM