The SharePoint website developed by the company used the Classic Mode authentication method (based on Windows AD ), the recent customer needs to make this used SharePoint application not only support the original ad authentication method, but also support the form method.
The problem arises. Generally, when we create a new web application, the system will let you decide which authentication the web application is based on, for example:
Once you deploy the web application, once you want to modify it, you can no longer find a way to reset the web application authentication method on the central administration interface of SharePoint.
Here, as a summary, describes the specific operation steps (some steps, especially the preparation steps, you can find a lot of reference on the internet, note them as a whole ).
1. Create the user database to be used for form authentication. aspnetdb is used here.
1.1 start cmd on the server (preferably in administrator mode) and go to the directory c: \ windows \ Microsoft. net \ framework \ v2.0.50727, you can also enter the CMD command line mode in this directory
1.2 run the aspnet_regsql.exe command to create the aspnetdb database. For the steps, see:
The following interface is displayed after the command is run:
Set the next path by default
After creation, you can find the created aspnetdb database on the server.
2. Create a user on the aspnetdb database.
You can create users on aspnetdb or quickly generate users using tools.
2.1 Download FBA user management tool
Http://fbamanagementtool.codeplex.com/
Http://cks.codeplex.com/releases/view/7450
2.2 decompress membershipseeder.zip, start membershipseeder.exe under the release directory, set config, users, and password respectively, and then click Create to create, as shown in:
This tool will create user1 in aspnetdb... User50 and other 50 users. The password is! Passw0rd.
You can go to the database to view the information:
3. Configure related web. config in the SharePoint Environment
There are mainly two web. config. (We recommend that you back up the original file before configuring any web. config file for recovery when SharePoint crashes due to misoperations)
1. c: \ Program Files \ common files \ microsoft shared \ Web Server Extensions \ 14 \ WebServices \ securitytoken \ Web. config
< System . Net >
< Connectionmanagement >
< Add Address = "*" Maxconnection = "10000" />
</ Connectionmanagement >
</ System.net >
< Connectionstrings >
< Add Name = "Fbasqlconnectionstring"
Connectionstring = "Data Source = MySQL; initial catalog = aspnetdb;
Persist Security info = true; user id = MyApp; Password = mypwd"
Providername = "System. Data. sqlclient" />
</ Connectionstrings >
< System . Web >
< Rolemanager Enabled = "True" Cacherolesincookie = "False" >
< Providers >
< Add Name = "Sqlroleprovider"
Type = "Microsoft. Sharepoint. Administration. Claims. spclaimsauthroleprovider,
Microsoft. Sharepoint, version = 14.0.0.0, culture = neutral,
Publickeytoken = 71e9bce111e9429c" />
< Add Connectionstringname = "Fbasqlconnectionstring"
Applicationname = "/"
Description = "Stores and retrieves roles from SQL Server"
Name = "Fbarole"
Type = "System. Web. Security. sqlroleprovider, system. Web,
Version = 2.0.3600.0, culture = neutral, publickeytoken = b03f5f7f11d50a3a" />
</ Providers >
</ Rolemanager >
< Membership >
< Providers >
< Add Name = "Sqlmembershipprovider"
Type = "Microsoft. Sharepoint. Administration. Claims. spclaimsauthmembershipprovider,
Microsoft. Sharepoint, version = 14.0.0.0, culture = neutral,
Publickeytoken = 71e9bce111e9429c" />
< Add Connectionstringname = "Fbasqlconnectionstring"
Passwordattemptwindow = "5"
Enablepasswordretrieval = "False"
Enablepasswordreset = "False"
Requiresquestionandanswer = "True"
Applicationname = "/"
Requiresuniqueemail = "True"
Passwordformat = "Hashed"
Description = "Stores and retrieves membership data from SQL Server"
Name = "Fbarole"
Type = "System. Web. Security. sqlmembershipprovider, system. Web,
Version = 2.0.3600.0, culture = neutral, publickeytoken = b03f5f7f11d50a3a" />
</ Providers >
</ Membership >
< Authentication Mode = "Windows" />
</ System. Web >
Second, modify the Web. config of the Configuration Management Center.
You can jump to the Management Center's web. config directory as shown in the following figure:
A. Add
< System . Net >
< Connectionmanagement >
< Add Address = "*" Maxconnection = "10000" />
</ Connectionmanagement >
</ System.net >
< Connectionstrings >
< Add Name = "Fbasqlconnectionstring"
Connectionstring = "Data Source = yourserver; initial catalog = aspnetdb;
Persist Security info = true; user id = MyApp; Password = mypwd"
Providername = "System. Data. sqlclient" />
</ Connectionstrings >
B. Update the rolemanager and membership nodes:
< Rolemanager Defaultprovider = "Aspnetwindow#enroleprovider" Enabled = "True" Cacherolesincookie = "False" >
< Providers >
< Add Name = "Sqlroleprovider"
Type = "Microsoft. Sharepoint. Administration. Claims. spclaimsauthroleprovider,
Microsoft. Sharepoint, version = 14.0.0.0, culture = neutral,
Publickeytoken = 71e9bce111e9429c" />
< Add Connectionstringname = "Fbasqlconnectionstring"
Applicationname = "/"
Description = "Stores and retrieves roles from SQL Server"
Name = "Fbarole"
Type = "System. Web. Security. sqlroleprovider, system. Web,
Version = 2.0.3600.0, culture = neutral, publickeytoken = b03f5f7f11d50a3a" />
</ Providers >
</ Rolemanager >
< Membership >
< Providers >
< Add Name = "Sqlmembershipprovider"
Type = "Microsoft. Sharepoint. Administration. Claims. spclaimsauthmembershipprovider,
Microsoft. Sharepoint, version = 14.0.0.0, culture = neutral,
Publickeytoken = 71e9bce111e9429c" />
< Add Connectionstringname = "Fbasqlconnectionstring"
Passwordattemptwindow = "5"
Enablepasswordretrieval = "False"
Enablepasswordreset = "False"
Requiresquestionandanswer = "True"
Applicationname = "/"
Requiresuniqueemail = "True"
Passwordformat = "Hashed"
Description = "Stores and retrieves membership data from SQL Server"
Name = "Fbarole"
Type = "System. Web. Security. sqlmembershipprovider, system. Web,
Version = 2.0.3600.0, culture = neutral, publickeytoken = b03f5f7f11d50a3a" />
</ Providers >
</ Membership >