

It is the value which has been stricken out in orange in the image below. The response from the request includes the security token needed to get the access token. This is done by POSTing the following XML as the request body to: The authentication piece comes in a few steps:įirst we must provide a username and password of a user with Contribute access to the Roster Data library and the URL at which we want access to the SharePoint Online Security Token Service. I will be providing examples of the requests using the ‘Advanced REST Client’ Google Chrome extension. I wrote about using the SharePoint REST API here (and background here, and here). The ADAL.js library is available for the cross-domain JS scenario. The type of applications where this kind of approach may be necessary include: a Java application, a PHP application, or JavaScript application where there is otherwise no SharePoint Online authentication context and the decision has been made (for whatever reason) that user authentication is most appropriate (as opposed to app authentication).Įdit: This approach will not work in a JavaScript environment due to cross-domain restrictions enforced by browsers (unless of course you are on the same domain, in which case you don’t need to worry about any of this anyway).

It then provides an example of using the same technique to upload a document and update metadata just to prove it all works 🙂 The goal of this post is to provide examples of the HTTP requests which need to be made in order to authenticate SharePoint Online. NET environment please refer to the ADAL library for authentication rather than writing it yourself. App authentication solves this issue for registered apps but I want to show how remote user authentication can be achieved, regardless of platform.

NET the authentication piece is not so straightforward.

The SharePoint REST API is touted as being the tool to provide inter-platform integration with SharePoint Online.
