I'm working with the following: - Azure MVC app (using organisational authentication with Azure AD) - WebAPI (within the MVC project) - SharePoint Online ## MVC => API ## I would like to use AJAX to communicate between the MVC page and the WebAPI rather than server postbacks. I'd also like to make the WebAPI available for other services that don't use the MVC portion of the app for future extensibility (e.g. PowerApps). As I understand it, I need to [use ADAL.js][1] to authenticate between the MVC page and the WebAPI rather than relying on passing authentication cookies in AJAX requests (as these time out frequently and [this is not the recommended approach][2]). ## API => SPO ## When the WebAPI receives an authenticated AJAX request from the MVC page, it should communicate with SharePoint Online - for example to update list items. Consent should be organisation-level rather than user-level. In order to communicate with SharePoint, I need to get a ClientContext object, which I think is possible via the helper methods in [OfficeDev PnP AuthenticationManager][3], provided I can [get hold of an access token][4]. **Can I somehow retrieve an access token from the WebAPI controller context** (as I have already authenticated with AzureAD via ADAL.js at this point in order to access the WebAPI) or do I need to [use ADAL.NET to retrieve an access token][5]? Thanks! [1]: https://github.com/Azure-Samples/active-directory-javascript-singlepageapp-dotnet-webapi [2]: https://stackoverflow.com/questions/32428929/mvc-ad-azure-refresh-token-via-adal-javascript-ajax-and-knockoutjs/32429127#32429127 [3]: https://github.com/OfficeDev/PnP-Sites-Core/blob/master/Core/OfficeDevPnP.Core/AuthenticationManager.cs [4]: https://github.com/OfficeDev/PnP/blob/master/Samples/BusinessApps.O365ProjectsApp/BusinessApps.O365ProjectsApp.Infrastructure/SPORemoteActions.cs [5]: https://blogs.msdn.microsoft.com/kaevans/2014/04/15/calling-o365-apis-from-your-web-api-on-behalf-of-a-user/ [6]: https://github.com/OfficeDev/PnP/blob/master/Samples/BusinessApps.O365ProjectsApp/BusinessApps.O365ProjectsApp.Infrastructure/MicrosoftGraph/MicrosoftGraphHelper.cs