You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-maps/how-to-secure-webapp-users.md
+23-26Lines changed: 23 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
-
title: How to secure a web application with interactive single-sign-in
2
+
title: How to secure a web application with interactive singlesign-in
3
3
titleSuffix: Azure Maps
4
-
description: How to configure a web application which supports Azure AD single-sign-on with Azure Maps Web SDK using OpenID Connect protocol.
4
+
description: How to configure a web application that supports Azure AD singlesign-in with Azure Maps Web SDK using OpenID Connect protocol.
5
5
author: eriklindeman
6
6
ms.author: eriklind
7
7
ms.date: 06/12/2020
@@ -13,49 +13,46 @@ ms.custom: devx-track-js
13
13
14
14
# Secure a web application with user sign-in
15
15
16
-
The following guide pertains to an application which is hosted on web servers, maintains multiple business scenarios, and deploys to web servers. The application has the requirement to provide protected resources secured only to Azure AD users. The objective of the scenario is to enable the web application to authenticate to Azure AD and call Azure Maps REST APIs on behalf of the user.
16
+
The following guide pertains to an application that is hosted on web servers, maintains multiple business scenarios, and deploys to web servers. The application has the requirement to provide protected resources secured only to Azure AD users. The objective of the scenario is to enable the web application to authenticate to Azure AD and call Azure Maps REST APIs on behalf of the user.
2. Enter a **Name**, choose a **Support account type**, provide a redirect URI which will represent the url which Azure AD will issue the token and is the url where the map control is hosted. For more details please see Azure AD [Scenario: Web app that signs in users](../active-directory/develop/scenario-web-app-sign-user-overview.md). Complete the provided steps from the Azure AD scenario.
28
+
2. Enter a **Name**, choose a **Support account type**, provide a redirect URI that represents the url to which Azure AD issues the token, which is the url where the map control is hosted. For more information, see Azure AD [Scenario: Web app that signs in users](../active-directory/develop/scenario-web-app-sign-user-overview.md). Complete the provided steps from the Azure AD scenario.
30
29
31
-
3. Once the application registration is complete, Confirm that application sign-in works for users. Once sign-in works, then the application can be granted delegated access to Azure Maps REST APIs.
32
-
33
-
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**.
30
+
3. Once the application registration is complete, confirm that application sign-in works for users. Once sign-in works, the application can be granted delegated access to Azure Maps REST APIs.
34
31
35
-
> [!div class="mx-imgBorder"]
36
-
> 
32
+
4. To assign delegated API permissions to Azure Maps, go to the application and select **API permissions** > **Add a permission**. select **Azure Maps** in the **APIs my organization uses** list.
6. Enable the web application to call Azure Maps REST APIs by configuring the app registration with an application secret, For detailed steps, see [A web app that calls web APIs: App registration](../active-directory/develop/scenario-web-app-call-api-app-registration.md). A secret is required to authenticate to Azure AD on-behalf of the user. The app registration certificate or secret should be stored in a secure store for the web application to retrieve to authenticate to Azure AD.
41
+
42
+
* This step may be skipped if the application already has an Azure AD app registration and secret configured.
43
+
44
+
> [!TIP]
45
+
> If the application is hosted in an Azure environment, we recommend using [Managed identities for Azure resources](../active-directory/managed-identities-azure-resources/overview.md) and an Azure Key Vault instance to access secrets by [acquiring an access token](../active-directory/managed-identities-azure-resources/how-to-use-vm-token.md) for accessing Azure Key Vault secrets or certificates. To connect to Azure Key Vault to retrieve secrets, see [tutorial to connect through managed identity](../key-vault/general/tutorial-net-create-vault-azure-web-app.md).
42
46
43
-
6. Enable the web application to call Azure Maps REST APIs by configuring the app registration with an application secret, For detailed steps, see [A web app that calls web APIs: App registration](../active-directory/develop/scenario-web-app-call-api-app-registration.md). A secret is required to authenticate to Azure AD on-behalf of the user. The app registration certificate or secret should be stored in a secure store for the web application to retrieve to authenticate to Azure AD.
44
-
45
-
* If the application already has configured an Azure AD app registration and a secret this step may be skipped.
47
+
7. Implement a secure token endpoint for the Azure Maps Web SDK to access a token.
46
48
47
-
> [!Tip]
48
-
> If the application is hosted in an Azure environment, we recommend using [Managed identities for Azure resources](../active-directory/managed-identities-azure-resources/overview.md) and an Azure Key Vault instance to access secrets by [acquiring an access token](../active-directory/managed-identities-azure-resources/how-to-use-vm-token.md) for accessing Azure Key Vault secrets or certificates. To connect to Azure Key Vault to retrieve secrets, see [tutorial to connect through managed identity](../key-vault/general/tutorial-net-create-vault-azure-web-app.md).
49
-
50
-
7. Implement a secure token endpoint for the Azure Maps Web SDK to access a token.
51
-
52
-
* For a sample token controller, see [Azure Maps Azure AD Samples](https://github.com/Azure-Samples/Azure-Maps-AzureAD-Samples/blob/master/src/OpenIdConnect/AzureMapsOpenIdConnectv1/AzureMapsOpenIdConnect/Controllers/TokenController.cs).
49
+
* For a sample token controller, see [Azure Maps Azure AD Samples](https://github.com/Azure-Samples/Azure-Maps-AzureAD-Samples/blob/master/src/OpenIdConnect/AzureMapsOpenIdConnectv1/AzureMapsOpenIdConnect/Controllers/TokenController.cs).
53
50
* For a non-AspNetCore implementation or other, see [Acquire token for the app](../active-directory/develop/scenario-web-app-call-api-acquire-token.md) from Azure AD documentation.
54
51
* The secured token endpoint is responsible to return an access token for the authenticated and authorized user to call Azure Maps REST APIs.
55
52
56
-
8.Configure Azure role-based access control (Azure RBAC) for users or groups. See[grant role-based access for users](#grant-role-based-access-for-users-to-azure-maps).
53
+
8.To configure Azure role-based access control (Azure RBAC) for users or groups, see[grant role-based access for users](#grant-role-based-access-for-users-to-azure-maps).
57
54
58
-
9. Configure the web application page with the Azure Maps Web SDK to access the secure token endpoint.
55
+
9. Configure the web application page with the Azure Maps Web SDK to access the secure token endpoint.
59
56
60
57
```javascript
61
58
var map =newatlas.Map("map", {
@@ -102,4 +99,4 @@ Find the API usage metrics for your Azure Maps account:
102
99
103
100
Explore samples that show how to integrate Azure AD with Azure Maps:
104
101
> [!div class="nextstepaction"]
105
-
> [Azure Maps Azure AD Web App Samples](https://github.com/Azure-Samples/Azure-Maps-AzureAD-Samples/tree/master/src/OpenIdConnect)
102
+
> [Azure Maps Azure AD Web App Samples](https://github.com/Azure-Samples/Azure-Maps-AzureAD-Samples/tree/master/src/OpenIdConnect)
0 commit comments