Skip to content

Commit b411053

Browse files
committed
Adding preview notes for AadHttpClient and MSGraphClient usage
1 parent e157d51 commit b411053

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

docs/spfx/use-aad-tutorial.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ ms.prod: sharepoint
1010
A very common business scenario for enterprise-level and real-life solutions is to consume REST API secured with Azure Active Directory (Azure AD) and Open Authorization (OAuth 2.0) from within a SharePoint Framework solution, whether it is a client-side web part or an extension.
1111
By using SharePoint Framework v.1.4.1 or later, you can leverage a set of out of the box capabilities to easily satisfy that business requirement, being able to consume either the Microsoft Graph, with a custom set of permission scopes, or any other REST API like a custom service registered in Azure AD.
1212

13+
> [!IMPORTANT]
14+
> Usage of `AadHttpClient` and `MSGraphClient` is currently in preview status and subject to change. You should not use these capabilities in production environment. Notice also that usage of `webApiPermissionRequests` properties in `package-solution.json` is not supported in normal tenants.
15+
1316
> [!IMPORTANT]
1417
> You can consume the Microsoft Graph with versions of SharePoint Framework older than v1.4.1, either using the native **graphHttpClient** member of the SharePoint Framework context, or with a manually implemented implicit flow of OAuth by using [ADAL JS](https://github.com/AzureAD/azure-activedirectory-library-for-js). However, the former approach is bound to a pre-defined set of permissions scopes, which allow you to do nothing more that what have been defined by Microsoft, and the latter is a bit complex from a development perspective. Nevertheless, for more information about the latter scenario, you can see the [Connect to API secured with Azure Active Directory](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/guidance/connect-to-api-secured-with-aad) article.
1518

docs/spfx/use-aadhttpclient.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ ms.prod: sharepoint
99

1010
When building SharePoint Framework solutions, you might need to connect to an API secured with Azure Active Directory. SharePoint Framework allows you to specify which Azure AD applications and permissions your solution requires, and tenant administrator can grant the necessary permissions if they haven't yet been granted. Using the **AadHttpClient** you can easily connect to APIs secured with Azure AD without having to implement the OAuth flow yourself.
1111

12+
> [!IMPORTANT]
13+
> Usage of `AadHttpClient` and `MSGraphClient` is currently in preview status and subject to change. You should not use these capabilities in production environment. Notice also that usage of `webApiPermissionRequests` properties in `package-solution.json` is not supported in normal tenants.
14+
15+
1216
## Web API permissions - concept overview
1317

1418
Azure Active Directory secures a number of resources: from Office 365 itself, to custom line of business applications built by the organization. In order to connect to these resources, applications must obtain a valid access token granting them access to the particular resource. Applications can obtain an access token as a part of the [OAuth authorization flow](https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-protocols-oauth-code). Client-side applications, such as SharePoint Framework solutions, which are incapable of storing a secret, use a specific type of OAuth flow, named [OAuth implicit flow](https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-dev-understanding-oauth2-implicit-grant).

docs/spfx/use-msgraph.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ ms.prod: sharepoint
99

1010
When building SharePoint Framework solutions, you can easily connect to the Microsoft Graph using the **MSGraphClient**.
1111

12+
> [!IMPORTANT]
13+
> Usage of `AadHttpClient` and `MSGraphClient` is currently in preview status and subject to change. You should not use these capabilities in production environment. Notice also that usage of `webApiPermissionRequests` properties in `package-solution.json` is not supported in normal tenants.
14+
1215
## What is MSGraphClient
1316

1417
**MSGraphClient** is a new HTTP client introduced in SharePoint Framework v1.4.1, that simplifies connecting to the Microsoft Graph inside SharePoint Framework solutions. **MSGraphClient** wraps the existing [Microsoft Graph JavaScript Client Library](https://www.npmjs.com/package/@microsoft/microsoft-graph-client) offering developers the same capabilities as when using the client library in other client-side solutions. While you could use the Microsoft Graph JavaScript Client Library in your solution directly, using the **MSGraphClient** will handle authenticating against the Microsoft Graph for you, allowing you to focus on building your solution.

0 commit comments

Comments
 (0)