security tagged posts

JQuery Plugin to obtain FormDigest code in SharePoint 2013

Category: #SharePointDevSharePoint 2013 Comments: One comment

In SharePoint 2013 Microsoft has put back the FormDigest security during the execution of the code. That means that if you are in a standard application page or web part you will not have any problem to create your web sites, update items etc… You can take a look over here for the details.

But if you want to do something more, like for example create your own service (in my case with Service Stack) you will always get a COM Exception from your page “System.Exception: Microsoft.SharePoint.SPException: The security validation for this page is invalid. Click Back in your Web”

The problem is that the header X-RequestDigest header is not passed automatically in your request, meaning that – even if you put AllowUnsafeUpdate to true – the operation will generate an exception.

This is the reason w...

Read More