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/active-directory/manage-apps/application-proxy-configure-native-client-application.md
+43-26Lines changed: 43 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,23 +12,23 @@ ms.workload: identity
12
12
ms.tgt_pltfrm: na
13
13
ms.devlang: na
14
14
ms.topic: conceptual
15
-
ms.date: 04/15/2019
15
+
ms.date: 05/12/2020
16
16
ms.author: mimart
17
17
ms.reviewer: japere
18
-
ms.custom: it-pro, has-adal-ref
18
+
ms.custom: it-pro
19
19
20
20
ms.collection: M365-identity-device-management
21
21
---
22
22
23
23
# How to enable native client applications to interact with proxy applications
24
24
25
-
You can use Azure Active Directory (Azure AD) Application Proxy to publish web apps, but it also can be used to publish native client applications that are configured with the Azure AD Authentication Library (ADAL). Native client applications differ from web apps because they're installed on a device, while web apps are accessed through a browser.
25
+
You can use Azure Active Directory (Azure AD) Application Proxy to publish web apps, but it also can be used to publish native client applications that are configured with the Microsoft Authentication Library (MSAL). Native client applications differ from web apps because they're installed on a device, while web apps are accessed through a browser.
26
26
27
27
To support native client applications, Application Proxy accepts Azure AD-issued tokens that are sent in the header. The Application Proxy service does the authentication for the users. This solution doesn't use application tokens for authentication.
28
28
29
29

30
30
31
-
To publish native applications, use the Azure AD Authentication Library, which takes care of authentication and supports many client environments. Application Proxy fits into the [Native Application to Web API scenario](../azuread-dev/native-app.md).
31
+
To publish native applications, use the Microsoft Authentication Library, which takes care of authentication and supports many client environments. Application Proxy fits into the [Desktop app that calls a web API on behalf of a signed-in user](https://docs.microsoft.com/azure/active-directory/develop/authentication-flows-app-scenarios#desktop-app-that-calls-a-web-api-on-behalf-of-a-signed-in-user) scenario.
32
32
33
33
This article walks you through the four steps to publish a native application with Application Proxy and the Azure AD Authentication Library.
34
34
@@ -53,8 +53,7 @@ You now need to register your application in Azure AD, as follows:
53
53
- To target only accounts that are internal to your organization, select **Accounts in this organizational directory only**.
54
54
- To target only business or educational customers, select **Accounts in any organizational directory**.
55
55
- To target the widest set of Microsoft identities, select **Accounts in any organizational directory and personal Microsoft accounts**.
56
-
57
-
1. In the **Redirect URI** heading, select **Public client (mobile & desktop)**, and then type the redirect URI for your application.
56
+
1. Under **Redirect URI**, select **Public client (mobile & desktop)**, and then type the redirect URI `https://login.microsoftonline.com/common/oauth2/nativeclient` for your application.
58
57
1. Select and read the **Microsoft Platform Policies**, and then select **Register**. An overview page for the new application registration is created and displayed.
59
58
60
59
For more detailed information about creating a new application registration, see [Integrating applications with Azure Active Directory](../develop/quickstart-register-app.md).
@@ -66,42 +65,60 @@ Now that you've registered your native application, you can give it access to ot
66
65
1. In the sidebar of the new application registration page, select **API permissions**. The **API permissions** page for the new application registration appears.
67
66
1. Select **Add a permission**. The **Request API permissions** page appears.
68
67
1. Under the **Select an API** setting, select **APIs my organization uses**. A list appears, containing the applications in your directory that expose APIs.
69
-
1. Type in the search box or scroll to find the proxy application that you published in [Step 1: Publish your proxy application](#step-1-publish-your-proxy-application), and then select the proxy application.
68
+
1. Type in the search box or scroll to find the proxy application that you published in [Step 1: Publish your proxy application](https://docs.microsoft.com/azure/active-directory/manage-apps/application-proxy-configure-native-client-application#step-1-publish-your-proxy-application), and then select the proxy application.
70
69
1. In the **What type of permissions does your application require?** heading, select the permission type. If your native application needs to access the proxy application API as the signed-in user, choose **Delegated permissions**.
71
70
1. In the **Select permissions** heading, select the desired permission, and select **Add permissions**. The **API permissions** page for your native application now shows the proxy application and permission API that you added.
72
71
73
-
## Step 4: Edit the Active Directory Authentication Library
72
+
## Step 4: Add the Microsoft Authentication Library to your code (.NET C# sample)
74
73
75
-
Edit the native application code in the authentication context of the Active Directory Authentication Library (ADAL) to include the following text:
74
+
Edit the native application code in the authentication context of the Microsoft Authentication Library (MSAL) to include the following text:
76
75
77
-
```
76
+
```
78
77
// Acquire Access Token from AAD for Proxy Application
79
-
AuthenticationContext authContext = new AuthenticationContext("https://login.microsoftonline.com/<Tenant ID>");
80
-
AuthenticationResult result = await authContext.AcquireTokenAsync("< External Url of Proxy App >",
81
-
"<App ID of the Native app>",
82
-
new Uri("<Redirect Uri of the Native App>"),
83
-
PromptBehavior.Never);
84
-
85
-
//Use the Access Token to access the Proxy Application
86
-
HttpClient httpClient = new HttpClient();
87
-
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", result.AccessToken);
88
-
HttpResponseMessage response = await httpClient.GetAsync("< Proxy App API Url >");
|\<App ID of the Native app> |**Application registration** > *your native application* > **Overview** > **Application ID**|
115
+
| \<Scope> | **Application registration** > *your native application* > **API permissions** > Click on the Permission API (user_impersonation) > A panel with the caption **user_impersonation** appears on the right hand side. > The scope is the URL in the edit box.
116
+
| \<Proxy App Url> | the External Url and path to the API
100
117
101
-
After you edit the ADAL with these parameters, your users can authenticate to native client applications even when they're outside of the corporate network.
118
+
After you edit the MSAL code with these parameters, your users can authenticate to native client applications even when they are outside of the corporate network.
102
119
103
120
## Next steps
104
121
105
122
For more information about the native application flow, see [Native apps in Azure Active Directory](../azuread-dev/native-app.md).
106
123
107
-
Learn about setting up [Single sign-on to applications in Azure Active Directory](what-is-single-sign-on.md#choosing-a-single-sign-on-method).
124
+
Learn about setting up [Single sign-on to applications in Azure Active Directory](what-is-single-sign-on.md#choosing-a-single-sign-on-method).
0 commit comments