A while back ago we already discussed how to consume SharePoint Online (SPO) REST in PowerShell. Here is a brief recap:
- it was stated that Invoke-RestMethod cmdlet could not be utilized for performing REST requests since it does not support claims-based authentication
- a custom Invoke-RestSPO function has been implemented that sends HTTPS requests to SPO RESTful web services. A SharePointOnlineCredentials class from SharePoint Client Component SDK was utilized for authentication which represents an object that provides credentials to access SharePoint Online resources.
This time I would like demonstrate another approach, in particular how PowerShell can gain authorization to SharePoint resources by passing an access token to SharePoint with each HTTP request. To issue an access token from Microsoft Azure Access Control Service (ACS) that allows the app access to the resources in the SharePoint tenancy we will implement the corresponding PowerShell function. Let’s get started.
Getting Access Token from Microsoft Azure Access Control Service
View original post 1,103 more words