不在自定义 MembershipProvider 中使用电子邮件地址?
我正在为遗留数据库编写一个自定义 MembershipProvider。 用户通过登录名和密码进行身份验证,没有附加电子邮件属性。 “短周期”FindUsersByEmail() 和 GetUserNameByEmail() 方法的最佳方法是什么? 我天真的做法是让它们不被实现,因为我假设如果不需要恢复密码,也不需要通过电子邮件查找用户——这有任何副作用吗?
I'm writing a custom MembershipProvider for a legacy database. Users are authenticated by login and password, there is no e-mail attribute attached. What is the best way to "short-cycle" the FindUsersByEmail()
and GetUserNameByEmail()
methods? My naive approach was to leave them unimplemented, since I assume if there is no need to restore a password, there is also no need to look up users by e-mail -- does this have any side effects?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我大胆猜测你会没事的。 快速浏览一下 Reflector 中的依赖关系就会发现,这些方法仅由 Membership 类的静态方法使用。
然而,由于这些是公共方法,其他第三方控件/API 可能会假设它们已实现。 某些 SharePoint API 似乎就是这种情况(请参阅灰色的私有方法) SPMembershipProviderPrincipalResolver 使用这两种方法。
http://img143.imageshack.us/img143/7097/windowclipping3rn3.png
I would hazard a guess that you will be okay. A quick look at the dependcies in Reflector shows that these methods are only used by static methods of the Membership class.
However since these are public methods other 3rd party controls / APIs may assume they are implemented. It seems this is the case with some of the SharePoint API (see the private methods in grey) SPMembershipProviderPrincipalResolver uses both of these methods.
http://img143.imageshack.us/img143/7097/windowclipping3rn3.png