My SP web application use FBA authentication (AD and aspnetSQLmembership providers). I want log in to SP site from custom SP login page. In code-behind page (my class inherit FormsSignInPage(ns:Microsoft.SharePoint.IdentityModel.Pages)I wrote

MembershipUserCollection msc = Membership.FindUsersByEmail(someEmailString);
if (msc != null && msc.Count == 1)
foreach (MembershipUser user in msc)
userName = user.UserName;
FormsAuthentication.RedirectFromLoginPage(userName, false);

Problem: When debugger come to "MembershipUserCollection msc = Membership.FindUsersByEmail(someEmailString);" it breaks and I get message "Exception Details: System.NotImplementedException: The method or operation is not implemented.". Should I somewhere in code need to specify which membership provider should be used (AD od SQL) or what?!?

Please, any suggestion will be appreciated.

2 Answers 2


If you use multiple membershipproviders, check in your web.config which one is the default one (under the <membership> tag). If the SqlMembershipProvider isn't the default one, you could get the provider by using:

MembershipProvider oProv = Membership.Providers["<Providername>"];
//and so on....

I've encountered this problem when using claims-based authentication, the default one was set on the claimsprovider, and if you use reflector to open up the dll that claims use, you'll see that most of the methods aren't implemented.

  • Thank you Ruben, i have claims provider setted as default, but when I use above code, i can get user from SqlMsProvider but can't get from default provider. I noticed that SqlMSProvider object has property _Initialized=true but ClaimProvider object has _Initialized=false. Does isn't clear for me because both providers should be active because i should be able to login with AD accounts same as sqlmembership accounts. Any idea? Any suggestion?
    – trip
    Jun 20, 2011 at 10:07

This is probably because you call the abstract class Membership instead of the specific implementation (SqlMembershipProvider).

Try using SqlMembershipProvider.FindUsersByEmail class instead.

  • Hi Anders, I managed to get provider in a way like Ruben explained. But i got another problem.
    – trip
    Jun 20, 2011 at 10:08
  • Well you should then flag his answer as correct and open a new question then Jun 20, 2011 at 17:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.