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/develop/tutorial-v2-windows-desktop.md
+32-32Lines changed: 32 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -79,6 +79,38 @@ To create your application, do the following:
79
79
> This command installs Microsoft Authentication Library. MSAL handles acquiring, caching, and refreshing user tokens that are used to access the APIs that are protected by Azure Active Directory v2.0
80
80
>
81
81
82
+
## Register your application
83
+
84
+
You can register your application in either of two ways.
85
+
86
+
### Option 1: Express mode
87
+
88
+
You can quickly register your application by doing the following:
89
+
1. Go to the [Azure portal - Application Registration](https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/applicationsListBlade/quickStartType/WinDesktopQuickstartPage/sourceType/docs).
90
+
1. Enter a name for your application and select **Register**.
91
+
1. Follow the instructions to download and automatically configure your new application with just one click.
92
+
93
+
### Option 2: Advanced mode
94
+
95
+
To register your application and add your application registration information to your solution, do the following:
96
+
1. Sign in to the [Azure portal](https://portal.azure.com) using either a work or school account or a personal Microsoft account.
97
+
1. If your account gives you access to more than one tenant, select your account in the top right corner, and set your portal session to the desired Azure AD tenant.
98
+
1. Navigate to the Microsoft identity platform for developers [App registrations](https://go.microsoft.com/fwlink/?linkid=2083908) page.
99
+
1. Select **New registration**.
100
+
- In the **Name** section, enter a meaningful application name that will be displayed to users of the app, for example `Win-App-calling-MsGraph`.
101
+
- In the **Supported account types** section, select **Accounts in any organizational directory and personal Microsoft accounts (for example, Skype, Xbox, Outlook.com)**.
102
+
- Select **Register** to create the application.
103
+
1. In the list of pages for the app, select **Authentication**.
104
+
1. In the **Redirect URIs** section, in the Redirect URIs list:
105
+
1. In the **TYPE** column select **Public client (mobile & desktop)**.
106
+
1. In the **REDIRECT URI** column, enter `urn:ietf:wg:oauth:2.0:oob`
107
+
1. Select **Save**.
108
+
1. Go to Visual Studio, open the *App.xaml.cs* file, and then replace `Enter_the_Application_Id_here` in the code snippet below with the application ID that you just registered and copied.
In addition to the access token that's used to call the Microsoft Graph API, after the user signs in, MSAL also obtains an ID token. This token contain a small subset of information that's pertinent to users. The `DisplayBasicTokenInfo` method displays the basic information that's contained in the token. For example, it displays the user's display name and ID, as well as the token expiration date and the string representing the access token itself. You can select the *Call Microsoft Graph API* button multiple times and see that the same token was reused for subsequent requests. You can also see the expiration date being extended when MSAL decides it is time to renew the token.
341
373
<!--end-collapse-->
342
374
343
-
## Register your application
344
-
345
-
You can register your application in either of two ways.
346
-
347
-
### Option 1: Express mode
348
-
349
-
You can quickly register your application by doing the following:
350
-
1. Go to the [Azure portal - Application Registration](https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/applicationsListBlade/quickStartType/WinDesktopQuickstartPage/sourceType/docs).
351
-
1. Enter a name for your application and select **Register**.
352
-
1. Follow the instructions to download and automatically configure your new application with just one click.
353
-
354
-
### Option 2: Advanced mode
355
-
356
-
To register your application and add your application registration information to your solution, do the following:
357
-
1. Sign in to the [Azure portal](https://portal.azure.com) using either a work or school account or a personal Microsoft account.
358
-
1. If your account gives you access to more than one tenant, select your account in the top right corner, and set your portal session to the desired Azure AD tenant.
359
-
1. Navigate to the Microsoft identity platform for developers [App registrations](https://go.microsoft.com/fwlink/?linkid=2083908) page.
360
-
1. Select **New registration**.
361
-
- In the **Name** section, enter a meaningful application name that will be displayed to users of the app, for example `Win-App-calling-MsGraph`.
362
-
- In the **Supported account types** section, select **Accounts in any organizational directory and personal Microsoft accounts (for example, Skype, Xbox, Outlook.com)**.
363
-
- Select **Register** to create the application.
364
-
1. In the list of pages for the app, select **Authentication**.
365
-
1. In the **Redirect URIs** section, in the Redirect URIs list:
366
-
1. In the **TYPE** column select **Public client (mobile & desktop)**.
367
-
1. Enter `urn:ietf:wg:oauth:2.0:oob` in the **REDIRECT URI** column.
368
-
1. Select **Save**.
369
-
1. Go to Visual Studio, open the *App.xaml.cs* file, and then replace `Enter_the_Application_Id_here` with the application ID that you just registered and copied.
0 commit comments