Skip to content

Commit 6f2f419

Browse files
authored
Merge pull request #108349 from stevemunk/how-to-secure-device-code
"How to secure device code" Improved grammar and created end links.
2 parents 1d5a94f + 3202074 commit 6f2f419

File tree

1 file changed

+27
-24
lines changed

1 file changed

+27
-24
lines changed

articles/azure-maps/how-to-secure-device-code.md

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
title: How to secure input constrained device with Azure AD and Azure Maps REST APIs
2+
title: How to secure an input constrained device using Azure AD and Azure Maps REST API
33
titleSuffix: Azure Maps
4-
description: How to configure a browser-less application which supports sign-in to Azure AD and calls Azure Maps REST APIs.
4+
description: How to configure a browser-less application that supports sign-in to Azure AD and calls Azure Maps REST API.
55
author: eriklindeman
66
ms.author: eriklind
77
ms.date: 06/12/2020
@@ -10,52 +10,48 @@ ms.service: azure-maps
1010
services: azure-maps
1111
---
1212

13-
# Secure an input constrained device with Azure AD and Azure Maps REST APIs
13+
# Secure an input constrained device by using Azure Active Directory (Azure AD) and Azure Maps REST APIs
1414

15-
This guide discusses how to secure public applications or devices that cannot securely store secrets or accept browser input. These types of applications fall under the category of IoT or internet of things. Some examples of these applications may include: Smart TV devices or sensor data emitting applications.
15+
This guide discusses how to secure public applications or devices that can't securely store secrets or accept browser input. These types of applications fall under the internet of things (IoT) category. Examples include Smart TVs and sensor data emitting applications.
1616

1717
[!INCLUDE [authentication details](./includes/view-authentication-details.md)]
1818

1919
## Create an application registration in Azure AD
2020

2121
> [!NOTE]
22-
> * **Prerequisite Reading:** [Scenario: Desktop app that calls web APIs](../active-directory/develop/scenario-desktop-overview.md)
22+
>
23+
> * **Prerequisite Reading:** [Scenario: Desktop app that calls web APIs]
2324
> * The following scenario uses the device code flow, which does not involve a web browser to acquire a token.
2425
25-
Create the device based application in Azure AD to enable Azure AD sign in. This application will be granted access to Azure Maps REST APIs.
26+
Create the device based application in Azure AD to enable Azure AD sign in, which is granted access to Azure Maps REST APIs.
2627

2728
1. In the Azure portal, in the list of Azure services, select **Azure Active Directory** > **App registrations** > **New registration**.
2829

29-
> [!div class="mx-imgBorder"]
30-
> ![App registration](./media/how-to-manage-authentication/app-registration.png)
30+
:::image type="content" source="./media/how-to-manage-authentication/app-registration.png" alt-text="A screenshot showing application registration in Azure AD":::
3131

32-
2. Enter a **Name**, choose **Accounts in this organizational directory only** as the **Supported account type**. In **Redirect URIs**, specify **Public client / native (mobile & desktop)** then add `https://login.microsoftonline.com/common/oauth2/nativeclient` to the value. For more details please see Azure AD [Desktop app that calls web APIs: App registration](../active-directory/develop/scenario-desktop-app-registration.md). Then **Register** the application.
32+
2. Enter a **Name**, choose **Accounts in this organizational directory only** as the **Supported account type**. In **Redirect URIs**, specify **Public client / native (mobile & desktop)** then add `https://login.microsoftonline.com/common/oauth2/nativeclient` to the value. For more information, see Azure AD [Desktop app that calls web APIs: App registration]. Then **Register** the application.
3333

34-
> [!div class="mx-imgBorder"]
35-
> ![Add app registration details for name and redirect uri](./media/azure-maps-authentication/devicecode-app-registration.png)
34+
:::image type="content" source="./media/azure-maps-authentication/devicecode-app-registration.png" alt-text="A screenshot showing the settings used to register an application.":::
3635

37-
3. Navigate to **Authentication** and enable **Treat application as a public client**. This will enable device code authentication with Azure AD.
36+
3. Navigate to **Authentication** and enable **Treat application as a public client** to enable device code authentication with Azure AD.
3837

39-
> [!div class="mx-imgBorder"]
40-
> ![Enable app registration as public client](./media/azure-maps-authentication/devicecode-public-client.png)
38+
:::image type="content" source="./media/azure-maps-authentication/devicecode-public-client.png" alt-text="A screenshot showing the advanced settings used to specify treating the application as a public client.":::
4139

4240
4. To assign delegated API permissions to Azure Maps, go to the application. Then select **API permissions** > **Add a permission**. Under **APIs my organization uses**, search for and select **Azure Maps**.
4341

44-
> [!div class="mx-imgBorder"]
45-
> ![Add app API permissions](./media/how-to-manage-authentication/app-permissions.png)
42+
:::image type="content" source="./media/how-to-manage-authentication/app-permissions.png" alt-text="A screenshot showing where you request API permissions.":::
4643

4744
5. Select the check box next to **Access Azure Maps**, and then select **Add permissions**.
4845

49-
> [!div class="mx-imgBorder"]
50-
> ![Select app API permissions](./media/how-to-manage-authentication/select-app-permissions.png)
46+
:::image type="content" source="./media/how-to-manage-authentication/select-app-permissions.png" alt-text="A screenshot showing where you specify the app permissions you require.":::
5147

52-
6. Configure Azure role-based access control (Azure RBAC) for users or groups. See [Grant role-based access for users to Azure Maps](#grant-role-based-access-for-users-to-azure-maps).
48+
6. Configure Azure role-based access control (Azure RBAC) for users or groups. For more information, see [Grant role-based access for users to Azure Maps].
5349

54-
7. Add code for acquiring token flow in the application, for implementation details see [Device code flow](../active-directory/develop/scenario-desktop-acquire-token-device-code-flow.md). When acquiring tokens, reference the scope: `user_impersonation` which was selected on earlier steps.
50+
7. Add code for acquiring token flow in the application, for implementation details see [Device code flow]. When acquiring tokens, reference the scope: `user_impersonation` that was selected on earlier steps.
5551

5652
> [!Tip]
5753
> Use Microsoft Authentication Library (MSAL) to acquire access tokens.
58-
> See recommendations on [Desktop app that calls web APIs: Code configuration](../active-directory/develop/scenario-desktop-app-configuration.md)
54+
> For more information, see [Desktop app that calls web APIs: Code configuration] in the active directory documentation.
5955
6056
8. Compose the HTTP request with the acquired token from Azure AD, and sent request with a valid HTTP client.
6157

@@ -70,7 +66,7 @@ x-ms-client-id: 30d7cc….9f55
7066
Authorization: Bearer eyJ0e….HNIVN
7167
```
7268

73-
The sample request body below is in GeoJSON:
69+
The following sample request body is in GeoJSON:
7470

7571
```json
7672
{
@@ -96,11 +92,18 @@ Operation-Location: https://us.atlas.microsoft.com/mapData/operations/{udid}?api
9692
Access-Control-Expose-Headers: Operation-Location
9793
```
9894

99-
10095
[!INCLUDE [grant role-based access to users](./includes/grant-rbac-users.md)]
10196

10297
## Next steps
10398

10499
Find the API usage metrics for your Azure Maps account:
100+
105101
> [!div class="nextstepaction"]
106-
> [View usage metrics](how-to-view-api-usage.md)
102+
> [View usage metrics]
103+
104+
[Desktop app that calls web APIs: App registration]: ../active-directory/develop/scenario-desktop-app-registration.md
105+
[Desktop app that calls web APIs: Code configuration]: ../active-directory/develop/scenario-desktop-app-configuration.md
106+
[Device code flow]: ../active-directory/develop/scenario-desktop-acquire-token-device-code-flow.md
107+
[Grant role-based access for users to Azure Maps]: #grant-role-based-access-for-users-to-azure-maps
108+
[Scenario: Desktop app that calls web APIs]: ../active-directory/develop/scenario-desktop-overview.md
109+
[View usage metrics]: how-to-view-api-usage.md

0 commit comments

Comments
 (0)