Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Is there a way to use only forms authentication with multiple membership providers? For example, a user would enter their username and password this would attempt to authenticate with, say, the SQL membership provider, if that fails then a different membership provider would be used.

I have tried something like this to switch the provider being used but this does not work, I know I can authenticate with the windows provider but in this case strictly using forms is preferred.

 iisSettings.FormsClaimsAuthenticationProvider.MembershipProvider = "admembers";
 bool status = SPClaimsUtility.AuthenticateFormsUser(Context.Request.UrlReferrer,
                                                     signInControl1.UserName, 
                                                     signInControl1.Password);
share|improve this question
add comment

1 Answer 1

That's only possible if you can modify the code of your membership provider and have it query all the possible user sources.

Since you can only use one membership provider per web application/zone, you must own the code of your membership provider to achieve a multi-source authentication process.

If you rely on an existing Microsoft-provided membership provider (such as the AD provider or the ASP.NET SQL provider) for instance, you can only authenticate your users against the user repositories those membership providers were designed to work with.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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