Contents
A better code sample for this operation would be: This is a much safer and more secure method of performing the same operation, but this method should not cause the security validation error. Code which uses classes and methods from the Microsoft.SharePoint.Administration namespace can often fall foul of this security validation error.
The error can come in SharePoint 2013/2016 or SharePoint Online. The error was coming like below: This error usually comes when you any POST Rest API call. Add the “X-RequestDigest” header, with the value of the hidden input field “__REQUESTDIGEST” which is the form digest value. Like below:
Is there a status 403 error in SharePoint?
Please your browser’s back button to try your operation again. status 403, FORBIDDEN. The error can come in SharePoint 2013/2016 or SharePoint Online. The error was coming like below:
Where do I change the security settings in SharePoint?
This can be done by changing the settings found at Central Administration > Application Management > Web Application General Settings. This is not an approach that I would recommend. You are compromising the security of an entire web application in order to allow a piece of custom code to function and that way bad things live.
Get-SPSite : ID4257: X.509 certificate ‘CN=SharePoint Security Token Service, OU=SharePoint, O=Microsoft, C=US’ validation failed by the token handler. I am not able to deactivate/activate any features on the server, it throws certificate error. I have already tried following: 1.
Are there two different types of security validation?
There are two different kinds of validation depending upon the type of action being taken and therefore two different solutions to this issue. Updating a site or site collection using the SPWeb and SPSite classes. This code could fail with the above error for two reasons.