Skip to content

Commit 720e8c1

Browse files
authored
Merge pull request #85470 from TylerMSFT/twhitney-github26041
change step order
2 parents 1197d90 + 5d13a6e commit 720e8c1

File tree

1 file changed

+32
-32
lines changed

1 file changed

+32
-32
lines changed

articles/active-directory/develop/tutorial-v2-windows-desktop.md

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,38 @@ To create your application, do the following:
7979
> 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
8080
>
8181
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.
109+
110+
```csharp
111+
private static string ClientId = "Enter_the_Application_Id_here";
112+
```
113+
82114
## Add the code to initialize MSAL
83115
84116
In this step, you create a class to handle interaction with MSAL, such as handling of tokens.
@@ -340,38 +372,6 @@ private void DisplayBasicTokenInfo(AuthenticationResult authResult)
340372
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.
341373
<!--end-collapse-->
342374

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.
370-
371-
```csharp
372-
private static string ClientId = "Enter_the_Application_Id_here";
373-
```
374-
375375
[!INCLUDE [5. Test and Validate](../../../includes/active-directory-develop-guidedsetup-windesktop-test.md)]
376376

377377
Help us improve the Microsoft identity platform. Tell us what you think by completing a short two-question survey.

0 commit comments

Comments
 (0)