Sharepoint 2010 上的亚马逊物流
我已经在 Sharepoint 2010 上实施了 FBA(基于声明的身份验证)。实施了以下内容。
- 自定义登录页面
- 自定义登录页面
- 密码恢复页面 (ForgetPassword.aspx)
在 ForgetPassword 页面中,用户被要求输入他们的电子邮件地址,他们在登录时使用,并且在后面的代码中我使用此电子邮件使用 Membership.GetUserNameByEmail 函数获取用户名,然后将此用户名传递给 Membership.GetUser 函数以获取通过邮件发送的用户凭证。
但现在代码抛出异常,提示“该函数未实现”。我想知道;我没有使用任何必须为其创建自定义会员资格提供商的自定义数据库。那为什么我会收到这个错误。如果有人有任何线索或遇到类似问题,请告诉我。谢谢。
问候, 稻田
I have implemented FBA (Claim based Authentication) on Sharepoint 2010. Following are implemented.
- Custom Login page
- Custom Sign-in Page
- Password recovery page (ForgetPassword.aspx)
In ForgetPassword page user is asked to enter their email address, they used while sign-in and in code behind I am using this email to get the UserName using the Membership.GetUserNameByEmail function and then passing this username to Membership.GetUser function to get the user credential to be send through mail.
But now the code throws as exception saying "The function is not implemented". I am wondering; I am not using any custom database for which I had to create a Custom Membership Provider. Then why I am getting this error. Let me know if anyone has any clue or faced similar problem. Thanks.
Regards,
Paddy
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为 SharePoint 2010 配置 FBA 时,会在
web.config
文件中定义两个成员资格提供程序 -Microsoft.SharePoint.Administration.Claims.SPClaimsAuthMembershipProvider
(通常名为 i )和System.Web.Security.SqlMembershipProvider
(在本例中名为FBAMembership)。默认成员资格提供程序必须设置为前者(即 SharePoint 声明之一)才能使 FBA 身份验证正常工作。当执行包含
Membership.GetUserNameByEmail(...)
的行时,将使用默认的成员资格提供程序,并因此调用SPClaimsAuthMembershipProvider.GetUserNameByEmail
。 MSDN 说此方法保留供内部使用,并不打算直接从您的代码中使用,并且根据社区内容部分中的注释,它会抛出NotImplementedException
。您需要从
Membership.Providers
集合中检索SqlMembershipProvider
提供程序的实例,然后使用该实例调用GetUserNameByEmail
方法。我在
web.config
文件中配置提供程序时使用前缀,并像这样检索它们:When FBA is configured for SharePoint 2010, two membership providers are defined in the
web.config
file -Microsoft.SharePoint.Administration.Claims.SPClaimsAuthMembershipProvider
(usually named i) andSystem.Web.Security.SqlMembershipProvider
(named FBAMembership in this case). Default membership provider must be set to the former (i.e. SharePoint claims one) in order for FBA authentication to work properly.When the line containing
Membership.GetUserNameByEmail(...)
is executed, the default membership provider is used and as a resultSPClaimsAuthMembershipProvider.GetUserNameByEmail
is called. MSDN says that this method is reserved for internal use and is not intended to be used directly from your code and according to the comment in the Community Content section it throwsNotImplementedException
.You need to retrieve an instance of the
SqlMembershipProvider
provider from theMembership.Providers
collection and then call theGetUserNameByEmail
method using this instance.I use prefixes when configuring providers in the
web.config
file and the retrieve them like this: