Reputation: 856
Will I be able to use the new REST File API from a service headlessly?
For example, I want to be able to create a service where the user gives consent once, and there-after the service may perform file operations (against sharepoint online) without explicit consent for months on end without intervention.
Such a thing is possible with other OAuth type REST apis (for instance the One Drive Rest API allows for it) by storing a refresh token and using it to get a new access token.
1) Is such a thing possible with these new APIs. The comment by "JTHAKE" in response to "Tdriver" here http://blogs.office.com/2014/05/12/net-and-javascript-libraries-for-office-365-apis/ . seems to hint that what I want isn't possible but I'm not sure why not.
Upvotes: 1
Views: 208
Reputation: 619
The new O365 rest APIs use the Common Consent framework in order to verify that the app has permission to use the APIs. This means that a user needs to first register an app in AAD & consent to the app's data use in the browser so that the app has the correct permissions. Once the app is consented to, completing the oauth flow headlessly will get you the right token to call the APIs from a service.
Upvotes: 1