SharePoint — GetXRequestDigest call is failing with 403

%3CLINGO-SUB%20id%3D%22lingo-sub-917496%22%20slang%3D%22en-US%22%3ESharePoint%20%E2%80%94%20GetXRequestDigest%20call%20is%20failing%20with%20403%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-917496%22%20slang%3D%22en-US%22%3E%3CP%3EWe%20are%20trying%20to%20connect%20Sharepoint%20online%20instance%20using%20SAML%20Authentication.%20We%20are%20trying%20to%20create%20site%20using%20Rest%20API.%20As%20we%20are%20using%20SAML%20authentication%20%2C%20we%20need%20to%20use%20%2Fcontextinfo%20to%20obtain%20request%20digest.%20This%20was%20working%20absolutely%20fine%20%2C%20but%20not%20sure%20why%20it%20is%20throwing%20error%20403%20now.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFollowing%20is%20the%20request%20sample%20%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EURL%3A%20%3CA%20href%3D%22https%3A%2F%2Fyourdomain.sharepoint.com%2F_api%2Fcontextinfo%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fyourdomain.sharepoint.com%2F_api%2Fcontextinfo%3C%2FA%3E%2C%20headers%3A%20%7B%20Cookie%3A%20rtFa%3Dxxxx%3BFedAuth%3Dxxx%3B%20Origin%3A%20yourdomain.sharepoint.com%20%7D%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3C!--%20%3Fxml%20version%3D%26quot%3B1.0%26quot%3B%20encoding%3D%26quot%3Butf-8%26quot%3B%3F%20--%3E-2147024891%2C%20System.UnauthorizedAccessExceptionAccess%20denied.%20You%20do%20not%20have%20permission%20to%20perform%20this%20action%20or%20access%20this%20resource.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor

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 }

 

-2147024891, System.UnauthorizedAccessExceptionAccess denied. You do not have permission to perform this action or access this resource.

0 Replies