3

Im trying to run Office 365 SharePoint Online REST API calls. I get an error message:

<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>
</m:error>
  • As authentication I tried different options:Global Http Settings / Preemptive / NTLM/Kerberos; obviously none of them work. Anyone can give me advice as what I'm doing wrong?
  • Anyone succeeded running REST API calls on SharePoint Online 2013?

Thanks.

UPDATE

The error message that I am getting

HTTP/1.1 403 Forbidden
Cache-Control: private, max-age=0
Content-Type: text/plain; charset=utf-8
Server: Microsoft-IIS/7.5    
X-SharePointHealthScore: 0
X-Forms_Based_Auth_Required: https://SITEURL.sharepoint.com/_forms/default.aspx?ReturnUrl=/_layouts/15/error.aspx&Source=%2f_vti_bin%2flists.asmx
X-Forms_Based_Auth_Return_Url: https://SITEURL.sharepoint.com/_layouts/15/error.aspx
X-MSDAVEXT_Error: 917656;     
Access+denied.+Before+opening+files+in+this+location%2c+you+must+first+browse+to+the+web+site+and+select+the+option+to+login+automatically.
X-AspNet-Version: 4.0.30319
SPRequestGuid: 5ad8999c-09cc-1018-5b28-e0ba7fe53991
request-id: 5ad8999c-09cc-1018-5b28-e0ba7fe53991
X-FRAME-OPTIONS: SAMEORIGIN
SPRequestDuration: 28
SPIisLatency: 0
X-IDCRL_AUTH_PARAMS_V1: IDCRL Type="BPOSIDCRL",         
EndPoint="/sites/SUBSITEURL/_vti_bin/idcrl.svc/", RootDomain="sharepoint.com", Policy="MBI"
X-Powered-By: ASP.NET
MicrosoftSharePointTeamServices: 16.0.0.2916
X-Content-Type-Options: nosniff
X-MS-InvokeApp: 1; RequireReadOnly
P3P: CP="ALL IEE DSP COR ADG CONo CUR CUSo IVAo IVDo PSA PDF TAS TELo OUR SAMo CNT CEE INT NAV ONL PWW PRE PUR UNI"
Date: Wed, 11 Jun 2014 14:33:12 GMT
Content-Length: 13

403 FORBIDDEN
3
  • Can someone please add a tag for SOAPUI.
    – bkk
    Commented Jun 11, 2014 at 13:36
  • 1
    Is SoapUI covered here?
    – wjervis
    Commented Jun 11, 2014 at 13:47
  • not sure where could post this query, as it had to do with SharePoint Online.
    – bkk
    Commented Jun 11, 2014 at 14:37

3 Answers 3

2

Look at http://paulryan.com.au/2014/spo-remote-authentication-rest/
It works for me (if I get you right). Just ignore stuff about digest - put mentioned 2 cookies into your header as Cookie:c1;c2 where c1 and c2 are authentication cookies (ones starting from FedAuth= and rtFa=).

1

The same issue has been reported on SoupUI forums, but there is no solution yet. The same issue is there in On-premise mode also. The issue lies in Authenticating the service.

There is workaround listed on there forum, You can check that.

1
  • I m looking to get SoapUI visit the Secure Token Webservice and get a session cookie. I haven't yet found out how to do this.
    – bkk
    Commented Jun 11, 2014 at 14:45
1

I fixed this issue using a header with some info about connection:

User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36

Add new Header at SoapUI Request, name it User-Agent, and the value is from the word Mozilla/5.0 to the end.

Grettings

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.