Skip to content

Commit 58c2213

Browse files
authored
Merge pull request #74 from Azure-Samples/jmprieur/defaultRedirectUri
changing the default redirect URI in subfolders 2. and 3.
2 parents 0b52cc2 + 4674891 commit 58c2213

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

2. Web API now calls Microsoft Graph/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ If you want to register your apps manually, as a first step you'll need to:
186186
- Select **Register** to create the application.
187187
1. On the app **Overview** page, find the **Application (client) ID** value and record it for later. You'll need it to configure the Visual Studio configuration file for this project (`ida:ClientId` in `TodoListClient\App.Config`).
188188
1. From the app's Overview page, select the **Authentication** section.
189-
1. In the **Redirect URIs** list, select for **TYPE** Public client (mobile & desktop). Then paste this value **urn:ietf:wg:oauth:2.0:oob** in the **REDIRECT URI** column.
189+
1. In the **Redirect URIs** list, under **Suggested Redirect URIs for public clients (mobile, desktop)** check the box next to **https://login.microsoftonline.com/common/oauth2/nativeclient**.
190190
1. Select **Save**.
191191
1. Select the **API permissions** section
192192
- Click the **Add a permission** button and then,

2. Web API now calls Microsoft Graph/TodoListClient/MainWindow.xaml.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ public MainWindow()
7979
InitializeComponent();
8080
_app = PublicClientApplicationBuilder.Create(ClientId)
8181
.WithAuthority(Authority)
82+
.WithDefaultRedirectUri()
8283
.Build();
8384

8485
TokenCacheHelper.EnableSerialization(_app.UserTokenCache);
@@ -221,7 +222,8 @@ await _app.AcquireTokenInteractive(scopes)
221222
else if (proposedAction == "consent")
222223
{
223224
IPublicClientApplication pca = PublicClientApplicationBuilder.Create(clientId)
224-
.Build();
225+
.WithDefaultRedirectUri()
226+
.Build();
225227
await pca.AcquireTokenInteractive(scopes)
226228
.WithPrompt(Prompt.Consent)
227229
.WithLoginHint(loginHint)

3.-Web-api-call-Microsoft-graph-for-personal-accounts/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ What **differs from the previous chapter** is that you will use the same applica
172172

173173
1. On the app **Overview** page, find the **Application (client) ID** value and record it for later. You'll need it to configure the Visual Studio configuration file for this project (`ida:ClientId` in `TodoListClient\App.Config`).
174174
1. From the app's Overview page, select the **Authentication** section.
175-
- In the **Redirect URLs** | Add the following redirect URI: **urn:ietf:wg:oauth:2.0:oob**
175+
- In the **Redirect URIs** list, under **Suggested Redirect URIs for public clients (mobile, desktop)** check the box next to **https://login.microsoftonline.com/common/oauth2/nativeclient**.
176176
- Select **Save**.
177177

178178
### Step 3: Configure the sample to use your Azure AD tenant

3.-Web-api-call-Microsoft-graph-for-personal-accounts/TodoListClient/MainWindow.xaml.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ public MainWindow()
7979
InitializeComponent();
8080
_app = PublicClientApplicationBuilder.Create(ClientId)
8181
.WithAuthority(Authority)
82+
.WithDefaultRedirectUri()
8283
.Build();
8384

8485
TokenCacheHelper.EnableSerialization(_app.UserTokenCache);
@@ -221,6 +222,7 @@ await _app.AcquireTokenInteractive(scopes)
221222
else if (proposedAction == "consent")
222223
{
223224
IPublicClientApplication pca = PublicClientApplicationBuilder.Create(clientId)
225+
.WithDefaultRedirectUri()
224226
.Build();
225227
await pca.AcquireTokenInteractive(scopes)
226228
.WithPrompt(Prompt.Consent)

0 commit comments

Comments
 (0)