Thursday, September 29, 2011

Server Error in ‘/’ Application. Runtime Error in Sharepoint2010

when ever you are get this error message you need do following 3 changes in your web.config file
1.In customErrors tag set mode="Off" to "On"
2.In SafeMode tag set CallStack="true" to "false"
3.In compilation tag debug="false" to "true"

after do these changes in web.config you get require error message in sharepoint
Ex: When i trying to create custom list columns more than 276. i got following error message
size of the columns in this list exceeds the limit. Please delete some other columns first.

Friday, September 23, 2011

Form based authentication(FBA) in sharepoint 2010

Form based Authentication:
Step1: create web application
Enable Form based authentication…
give names for Membership provider and Role Provider at this point.
Take default or custom sign in page as you wish.
Step2: now we have to create Connection string, membership provider and role provider for all three web.config file… 1.our application’s
2. Secure Token Service’s and
3. Central administrator’s.
Step3: go to c:\windows\Microsoft.NET\Framework\V2.0.5…
Double click on aspnet_regsql..
Configure Sql Server…
Give your Sql server name and database name…
Step4: Go to Administrative Tools  Internet Information Service manager
Sites  our application
On the features pane double click on Connection Strings…
1.Give your own connection string name
2.Server Name
3.Data base name
Step5 : back to Features pane Double click on Providers…
Role Provider
1. Select Roles in dropdown…
2. Click on ADD on left side Pane
3. Select SqlRoleProvider on Dropdown List
4. Give Name of Role Provider (ex:CertusRole)
5. Select your connection sting from Dropdown
6. In Application name Text box give as “/”
7. Click save
Membership Provider

1. Select Users in dropdown…
2. Click on ADD on left side Pane
3. Select SqlMembershipProvider on Dropdown List
4. Give Name of Role Provider (ex:CertusMember)
5. Make true for all options of membership provider
6. Select your connection sting from Dropdown
7. In Application name Text box give as “/”
8. Click save
Step6 : Repeat steps 4 and 5 for creating Connetion String, Role Provider and Membership Provider for Central administrator and Secure Token Service…
Step7: come back to our site in ISS manager ….
Select our web application..
Now we have to create roles and Users
I) select .Net Roles -- >click on default provider select your Role Provider Name (ex FBARole)
-- > Click on Add users like (admin, standard).
II) select .Net Users --- >click on default provider select your Member ship provider
( FBAMember)
--- > Click on Add select admin give full details.
Step8: Now you have make the change default Role provider and Membership Providers
1. Go to .Net Role in Features Pane
2. Set Default Role Provider as “i”
3. Go to .Net Users in Features pane
4. Set Default Membership provider as “c”.

Now are almost succeeded in provide Form based Authentication to your web application , but you may get these exception
“You must Specify non auto generated machine key…..”
Resolution: After Completed the creation of Connection string , Role Provider and Membership Provider You should mention tag in each of 3 Web application’s web.config files in three places
1. In ConnectionStrin
2. In providers under membershipProvider
3. In provider under roleProvider
“Acess Denied”
You should give Permission for NTAuthority/Network Service in Sql Server..
-- Create a SQL Server login for the Network Service account
sp_grantlogin 'NT AUTHORITY\Network Service'

-- Grant the login access to the membership database
USE DataBaseName
GO
sp_grantdbaccess 'NT AUTHORITY\Network Service', 'Network Service'

-- Add user to database role
USE DataBaseName
GO
sp_addrolemember 'aspnet_Membership_FullAccess', 'Network Service'


Then go to Central administration Manage web applications
select your web application
select Authentication Providers
 Give your Membership provider name and role Provider name
Now select User Policy add your Membership Users and Give permissions…
Then it will work properly…