Skip to content

Commit ab2a014

Browse files
committed
Polishing docs and fixing wording
1 parent be008f4 commit ab2a014

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

docs/spfx/use-aad-tutorial.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
---
22
title: Tutorial - Consuming APIs secured with Azure Active Directory within SharePoint Framework
3-
description: Tutorial on using the AadHttpClient or MSGraphClient class to connect to AAD-secured APIs in SharePoint Framework solutions.
3+
description: Tutorial on using the AadHttpClient or MSGraphClient class to connect to Azure AD secured APIs in SharePoint Framework solutions.
44
ms.date: 02/15/2018
55
ms.prod: sharepoint
66
---
77

88
# Tutorial: Consuming APIs secured with Azure Active Directory within SharePoint Framework
99

10-
A very common business scenario for enterprise-level and real-life solutions is to consume REST API secured with Azure Active Directory (AAD) and Open Authorization (OAuth 2.0) from within a SharePoint Framework solution, whether it is a client-side web part or an extension.
11-
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 AAD.
10+
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.
11+
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

1313
> [!IMPORTANT]
1414
> 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.
1515
1616
Reading this tutorial you will learn - through a step by step approach - how to create a SharePoint Framework solution that consumes the Microsoft Graph, with a custom set of permission scopes.
1717

1818
> [!NOTE]
19-
> To better undestand the overall architecture of this capability, you can read the article [Connect to AAD-secured APIs in SharePoint Framework solutions](use-aadhttpclient.md).
19+
> To better undestand the overall architecture of this capability, you can read the article [Connect to Azure AD secured APIs in SharePoint Framework solutions](use-aadhttpclient.md).
2020
2121
## <a name="SolutionOverview"></a>Overview of the solution
2222
Before digging into the detailed steps of developing the solution, let's have a quick overview of what you are going to build.
2323
In the following screenshot, you can see the UI of a client-side web part that allows to search for users in the current tenant. The search is based on the Microsoft Graph and requires at least the *User.ReadBasic.All* permission.
2424

2525
![The UI of the sample application](../images/use-aad-tutorial-video.gif)
2626

27-
As you can see, the client-side web part allows to search users based on their name, and provides all the matching users through a **DetailsList** component of Office UI Fabric. Moreover, the web part has a configurable option, available in the property pane, to select how to access the Microsoft Graph. In fact, starting from SharePoint Framework v.1.4.1 you can access the Microsoft Graph either using the native graph client (**MSGraphClient**), or the low level type to access any AAD-secured REST API (**AadHttpClient**).
27+
As you can see, the client-side web part allows to search users based on their name, and provides all the matching users through a **DetailsList** component of Office UI Fabric. Moreover, the web part has a configurable option, available in the property pane, to select how to access the Microsoft Graph. In fact, starting from SharePoint Framework v.1.4.1 you can access the Microsoft Graph either using the native graph client (**MSGraphClient**), or the low level type to access any Azure AD secured REST API (**AadHttpClient**).
2828

2929
> [!NOTE]
3030
> You can find the full source code of the sample solution in the following GitHub repository [spfx-api-scopes-tutorial](#).
@@ -440,7 +440,7 @@ In SharePoint Framework v.1.4.1 or later you can do that by configuring the *web
440440
```
441441
442442
Notice the *webApiPermissionRequests*, which is an array of *webApiPermissionRequest* items. Each item defines the *resource* and the *scope* of the permission request.
443-
The *resource* can be the name or the ObjectId (in AAD) of the resource for which you want to configure the permission request. For the Microsoft Graph the name is "Microsoft Graph", while the ObjectId is not unique and varies on a per tenant basis.
443+
The *resource* can be the name or the ObjectId (in Azure AD) of the resource for which you want to configure the permission request. For the Microsoft Graph the name is "Microsoft Graph", while the ObjectId is not unique and varies on a per tenant basis.
444444
The *scope* can be the name of the permission scope, or the unique ID of that permission scope. The former can be retrieved reading the documentation of the target API, while the latter can be retrieved reading the manifest file of the target API.
445445
446446
> [!NOTE]
@@ -642,11 +642,11 @@ https://<your-tenant>.sharepoint.com/_layouts/15/Workbench.aspx
642642
```
643643
644644
Add the *GraphConsumer* client-side web part, configure the *Client Mode* and search for users.
645-
The first request you will make, you will see a pop-up window popping out and then disappearing. That's the logon window used by ADAL JS, which is internally used by the SharePoint Framework to retrieve the Access Token from AAD using and OAuth implicit flow.
645+
The first request you will make, you will see a pop-up window popping out and then disappearing. That's the logon window used by ADAL JS, which is internally used by the SharePoint Framework to retrieve the Access Token from Azure AD using and OAuth implicit flow.
646646
647647
![The UI of the sample application](../images/use-aad-tutorial-video.gif)
648648
649-
And that's it! Enjoy this capability building real-life enterprise-level solutions that levarage AAD-secured REST API.
649+
And that's it! Enjoy this capability building real-life enterprise-level solutions that leverage Azure AD-secured REST API.
650650
651651
<a name="SeeAlso"></a>
652652

docs/spfx/use-aadhttpclient.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
2-
title: Connect to AAD-secured APIs in SharePoint Framework solutions
2+
title: Connect to Azure AD secured APIs in SharePoint Framework solutions
33
description: Use the AadHttpClient class to connect to AAD-secured APIs in SharePoint Framework solutions.
44
ms.date: 02/15/2018
55
ms.prod: sharepoint
66
---
77

8-
# Connect to AAD-secured APIs in SharePoint Framework solutions
8+
# Connect to Azure AD secured APIs in SharePoint Framework solutions
99

10-
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 AAD without having to implement the OAuth flow yourself.
10+
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

1212
## Web API permissions - concept overview
1313

@@ -16,19 +16,19 @@ Azure Active Directory secures a number of resources: from Office 365 itself, to
1616
Developers building client-side solutions are responsible for implementing authorization using the OAuth implicit flow in their application. In SharePoint Framework solutions that's already done as a part of the framework through the **MSGraphClient** and **AadHttpClient** both introduced in SharePoint Framework v1.4.1.
1717

1818
> [!NOTE]
19-
> If you build solutions on a version of the SharePoint Framework older than v1.4.1 you can still connect to resources secured with AAD. In that case you need to implement the OAuth implicit flow using [ADAL JS](https://github.com/AzureAD/azure-activedirectory-library-for-js) yourself. For more information 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.
19+
> If you build solutions on a version of the SharePoint Framework older than v1.4.1 you can still connect to resources secured with Azure AD. In that case you need to implement the OAuth implicit flow using [ADAL JS](https://github.com/AzureAD/azure-activedirectory-library-for-js) yourself. For more information 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.
2020
2121
As a part of the SharePoint Framework, there is a specific process defined for how developers can request- and tenant administrators can manage permissions to resources secured with Azure AD. The following schema illustrates this process.
2222

2323
![Schema illustrating the flow of requesting, granting and using permissions to Azure AD applications](../images/webapipermissions-logical.png)
2424

25-
Developers building a SharePoint Framework solution, that requires access to specific resources secured with AAD, list these resources along with the required permission scopes in the solution manifest (1). When deploying the solution package to the app catalog, SharePoint will create permission requests and will prompt the administrator to manage the requested permissions (2). For each requested permission, tenant administrators can decide whether they want to grant or deny the specific permission (3).
25+
Developers building a SharePoint Framework solution, that requires access to specific resources secured with Azure AD, list these resources along with the required permission scopes in the solution manifest (1). When deploying the solution package to the app catalog, SharePoint will create permission requests and will prompt the administrator to manage the requested permissions (2). For each requested permission, tenant administrators can decide whether they want to grant or deny the specific permission (3).
2626

2727
All permissions are granted to the whole tenant and not to a specific application that has requested them. When tenant administrator grants a specific permission, it is added to the **SharePoint Online Client Extensibility** Azure AD application, which is provisioned by Microsoft in every Azure Active Directory and which is used by the SharePoint Framework in the OAuth flow to provide solutions with valid access tokens.
2828

2929
## Discover available applications and permissions
3030

31-
For which applications you can request permissions in your solution, depends on the target Azure Active Directory which secures your Office 365 tenant. The list of available application might depend on the Office 365 license the organization is using and which line of business applications they registered in their AAD. Assuming you have sufficient permissions, there are a number of ways in which you can see which applications and permission scopes are available in your tenant.
31+
For which applications you can request permissions in your solution, depends on the target Azure Active Directory which secures your Office 365 tenant. The list of available application might depend on the Office 365 license the organization is using and which line of business applications they registered in their Azure AD. Assuming you have sufficient permissions, there are a number of ways in which you can see which applications and permission scopes are available in your tenant.
3232

3333
### Azure Portal
3434

@@ -46,7 +46,7 @@ To quicker find the application to which you want to connect, you can filter the
4646

4747
Assuming you wanted to request additional permissions to the Microsoft Graph, in the search box you would search for `graph`.
4848

49-
![Searching for 'graph' in the list of available AAD applications in the Azure AD portal](../images/webapipermissions-aadportal-searchgraph.png)
49+
![Searching for 'graph' in the list of available Azure AD applications in the Azure AD portal](../images/webapipermissions-aadportal-searchgraph.png)
5050

5151
Once you find the application, click on it, to get its additional information. Once on the application blade, from the **Manage** group, click the **Properties** link, to open application's properties.
5252

@@ -128,7 +128,7 @@ If your SharePoint Framework solution requires permissions to specific resources
128128
```
129129

130130
> [!NOTE]
131-
> As the value of the **resource** property you can specify either the **displayName** or the **objectId** of the application to which you want to request permissions. Using the displayName is not only more readable but it also allows you to build your solution once and reuse it across multiple tenants. Where the **objectId** of an AAD application is different on each tenant, the **displayName** stays the same.
131+
> As the value of the **resource** property you can specify either the **displayName** or the **objectId** of the application to which you want to request permissions. Using the displayName is not only more readable but it also allows you to build your solution once and reuse it across multiple tenants. Where the **objectId** of an Azure AD application is different on each tenant, the **displayName** stays the same.
132132
133133
If you want to request multiple permission scopes for the given resource, specify each scope in a separate entry, for example:
134134

@@ -326,7 +326,7 @@ If you need to revoke a previously granted permission, you can do that using the
326326
327327
## Connect to Azure AD applications using the AadHttpClient
328328

329-
Starting from version 1.4.1, SharePoint Framework simplifies connecting to APIs secured with AAD. Using the new **AadHttpClient** you can easily connect to APIs secured with AAD, without having to implement authentication and authorization yourself. Internally, the **AadHttpClient** implements the Azure AD OAuth flow using ADAL JS using the **SharePoint Online Client Extensibility** service principal to obtain a valid access token. The **SharePoint Online Client Extensibility** service principal is provisioned by Microsoft and available in the Azure Active Directory of all Office 365 tenants.
329+
Starting from version 1.4.1, SharePoint Framework simplifies connecting to APIs secured with Azure AD. Using the new **AadHttpClient** you can easily connect to APIs secured with Azure AD, without having to implement authentication and authorization yourself. Internally, the **AadHttpClient** implements the Azure AD OAuth flow using ADAL JS using the **SharePoint Online Client Extensibility** service principal to obtain a valid access token. The **SharePoint Online Client Extensibility** service principal is provisioned by Microsoft and available in the Azure Active Directory of all Office 365 tenants.
330330

331331
To use the **AadHttpClient** in your SharePoint Framework solution, add the following `import` clause in your main web part file:
332332

0 commit comments

Comments
 (0)