Thursday, March 4, 2010

SharePoint: Forms Based Authentication

In this post, I am going to detail about implementing Forms Based Authentication in SharePoint Server for a Web application.

Scenario: If you have t0 have only Non Domain users to access a specific site and those user credentials will be different from Domain credentials and more over those users have to be created by using ASP.NET Configuration wizard then Forms Based Authentication is the best solution for this scenario.

The following simple steps allow you to create the Forms Based Authentication.

Step 1: Browse to Central Administration -> Application Management -> create or extend Web application -> Create a new Web application. And then create the Site Collection for this site and make sure that you do not open/browse the site yet.




Step 2: Now open the SQL Server Management Studio, and create a new database in SQL Server, by right clicking the Databases and select Create a New Database and then give the name to the database and click on Create - Your new database will be created.


Step 3: Go to Visual Studio 2005 Command prompt and run aspnet_regsql and in the UI, select the newly created database in step 2 and complete the aspnet_regsql wizard.





Step 4: Now open Visual Studio 2005 and create a new Project by selecting ASP.NET Web application template. In the web.config file that is created along with the Project, add the Connection string just above the System.web tag, as below:






Step 5: Now in the Solution Explorer you will be having the aspnet Configuration Icon, click on that icon which takes you to Website Administration Tool in which you need to go to Security Tab and select Authentication type and then select Internet option and then click on Security Tab in which you will be finding the Create Users option. Click on the Create Users option and then create a sample user eg., test.





Step 6: Now go to Central Administration -> Application Management ->Authentication Providers and then change the Authentication type to 'Form' and membership provider name to 'AspNetSqlMembershipProvider'.


Step 7: Add the same connection string just above the system.web tag in Step 4 in both Central Administration Web application's web.config file and also in the SharePoint Web application created in Step 1's web.config file.


Step 8: Now change the SharePoint Web Application's Site Collection Administrator to 'test' created in Step 5. This can be achieved by going to Central Administration -> Application Management tab -> Site Collection Administrators.


Step 9: Close the Central Administration Site.

Step 10: Now open the SharePoint Web Application Site created in Step 1 and you will be finding the login screen in which you have to provide the newly created 'test' user credentials in Step 5.


1 comment:

  1. I could not resist commenting. Exceptionally well written!


    my blog: Solve Captchas

    ReplyDelete

Please Leave Your Comments Here On This Post.....

Followers