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

I want to implement forms based authentication for a sharepoint portal. I have used the standard ASP.NET membership provider database for test purpose and it work fine.

My client has Authentication details on their own SQL Database and I want to implement FBA that uses the custom database to authenticate users.

Does any one have any suggestions on how to implement this. Do I need to write a custom authentication provider?

share|improve this question
add comment

3 Answers 3

up vote 1 down vote accepted

If the schema of custom DB is same as aspnetDB, You can use the same provider with relevant connectionString in the central admin and the web application config.You can provide userid\pwd in the connectionString as below:

<connectionStrings>
  <add name="MySqlConnection" connectionString="Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated Security=SSPI;User ID=myDomain\myUsername; Password=myPassword;" />
</connectionStrings>
<system.web>
...
  <membership defaultProvider="SqlProvider" userIsOnlineTimeWindow="15">
    <providers>
      <clear />
      <add 
        name="SqlProvider" 
        type="System.Web.Security.SqlMembershipProvider" 
        connectionStringName="MySqlConnection"
        applicationName="MyApplication"
        enablePasswordRetrieval="false"
        enablePasswordReset="true"
        requiresQuestionAndAnswer="true"
        requiresUniqueEmail="true"
        passwordFormat="Hashed" />
    </providers>
  </membership>
share|improve this answer
    
Hi Amit, the schema is different –  Kannan Feb 24 '12 at 5:18
    
Then you have to build a custom provider. This may be helpful : codeproject.com/Articles/165159/Custom-Membership-Providers –  Amit Kumawat Feb 24 '12 at 14:22
add comment

Have a look at SharePoint 2010 FBA Pack:

http://sharepoint2010fba.codeplex.com/

A forms based authentication pack for SharePoint 2010. It includes web parts for registering users, changing passwords and password recovery. It includes tools for managing users and roles and for approving registrations.

share|improve this answer
    
Hi Ashish, Does this work with custom database? –  Kannan Feb 26 '12 at 23:41
    
Yes, check the documentation - sharepoint2010fba.codeplex.com/documentation and follow the first link. –  Ashish Patel Feb 26 '12 at 23:45
add comment

I suggest you create you own MembershipProvider implementation since you are not going to use the default FBA database, but a custom database instead. It is not such a difficult to implement your own. check out these link http://msdn.microsoft.com/en-us/library/f1kyba5e.aspx

share|improve this answer
    
Creating custom membership is tricky. On the paper seems easy, but you really need to know what you do. But that's the way you should follow. –  trip Feb 24 '12 at 13:00
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.