We are trying to connect Sharepoint online instance using SAML Authentication. We are trying to create site using Rest API. As we are using SAML authentication , we need to use /contextinfo to obtain request digest. This was working absolutely fine , but not sure why it is throwing error 403 now.

Following is the request sample :

URL: https://yourdomain.sharepoint.com/_api/contextinfo,
headers: {
Cookie: rtFa=xxxx;FedAuth=xxx;
Origin: yourdomain.sharepoint.com

<?xml version="1.0" encoding="utf-8"?>
<m:error xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
    <m:code>-2147024891, System.UnauthorizedAccessException</m:code>
    <m:message xml:lang="en-US">Access denied. You do not have permission to perform this action or access this resource.</m:message>

Need some help to resolve this issue.

1 Answer 1


You could use Fiddler to check the rtFa and FedAuth to confirm whether the cookie correct.


enter image description here

  • Hi Lee, thanks for the the help, the API was working fine nearly 3 weeks ago, but it is failing now, need to confirm on one point: is there any changes from API Side, If yes then need help to resolve the same issue.
    – crk2904
    Commented Oct 9, 2019 at 10:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.