IMPORTANT: According to the comments, this method doesn't work in all cases. For example, you cannot provide 'App Domain' value to be used inside SharePoint provider-hosted addin. If you need it only for some background jobs (which use app-only authentication), then you still can use below method. I bet you know about a page in SharePoint with address...

SharePoint

Consuming third party or your own Azure AD protected API from SPFx code is a very common need. I wrote a blog post series on that topic, the first one you can find here. All solutions I covered have their own pros and cons, however the less painful and recommended solution is AadHttpClient (available in SPFx 1.6 and onwards). AadHttpClient approach has less....

SharePoint

1. Call Azure AD secured API from your SPFx code. Story #1: Azure Functions with cookie authentication (xhr "with credentials") 2. Call Azure AD secured API from your SPFx code. Story #1.1: Azure Web App with ASP.NET Core 2.x and cookie authentication (xhr "with credentials") 3. Call Azure AD secured API from your SPFx code. Story #2: Web app (or Azure...

SharePoint

1. Call Azure AD secured API from your SPFx code. Story #1: Azure Functions with cookie authentication (xhr "with credentials") 2. Call Azure AD secured API from your SPFx code. Story #1.1: Azure Web App with ASP.NET Core 2.x and cookie authentication (xhr "with credentials") 3. Call Azure AD secured API from your SPFx code. Story #2: Web app (or Azure...

SharePoint

1. Call Azure AD secured API from your SPFx code. Story #1: Azure Functions with cookie authentication (xhr "with credentials") 2. Call Azure AD secured API from your SPFx code. Story #1.1: Azure Web App with ASP.NET Core 2.x and cookie authentication (xhr "with credentials") Access the API by leveraging SharePoint Online authentication cookie. This post...

SharePoint

1. Call Azure AD secured API from your SPFx code. Story #1: Azure Functions with cookie authentication (xhr "with credentials") adal.js, at the same time it’s simple, however, has its own cons (read at the end of the article). More info about this approach you can find here - Access the API by leveraging SharePoint Online authentication cookie. In another...