Skip to content

Commit 9aab6ee

Browse files
authored
Merge branch 'master' into bogavril/fixcleanup
2 parents 4bbe4a0 + a0bd598 commit 9aab6ee

28 files changed

+198
-148
lines changed

1. Desktop app calls Web API/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ If you want to register your apps manually, as a first step you'll need to:
164164
- Select **Register** to create the application.
165165
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`).
166166
1. From the app's Overview page, select the **Authentication** section.
167-
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.
167+
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**.
168168
1. Select **Save**.
169169
1. Select the **API permissions** section
170170
- Click the **Add a permission** button and then,

1. Desktop app calls Web API/TodoListClient/MainWindow.xaml.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ public MainWindow()
7575
InitializeComponent();
7676
_app = PublicClientApplicationBuilder.Create(ClientId)
7777
.WithAuthority(Authority)
78+
.WithDefaultRedirectUri()
7879
.Build();
7980

8081
TokenCacheHelper.EnableSerialization(_app.UserTokenCache);

1. Desktop app calls Web API/TodoListClient/TodoListClient.csproj

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,6 @@
3636
<WarningLevel>4</WarningLevel>
3737
</PropertyGroup>
3838
<ItemGroup>
39-
<Reference Include="Microsoft.Identity.Client, Version=4.0.0.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae, processorArchitecture=MSIL">
40-
<HintPath>..\packages\Microsoft.Identity.Client.4.0.0\lib\net45\Microsoft.Identity.Client.dll</HintPath>
41-
</Reference>
42-
<Reference Include="Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
43-
<HintPath>..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
44-
</Reference>
4539
<Reference Include="System" />
4640
<Reference Include="System.Configuration" />
4741
<Reference Include="System.Data" />
@@ -102,9 +96,6 @@
10296
<Generator>ResXFileCodeGenerator</Generator>
10397
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
10498
</EmbeddedResource>
105-
<None Include="packages.config">
106-
<SubType>Designer</SubType>
107-
</None>
10899
<None Include="Properties\Settings.settings">
109100
<Generator>SettingsSingleFileGenerator</Generator>
110101
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
@@ -116,6 +107,14 @@
116107
<SubType>Designer</SubType>
117108
</None>
118109
</ItemGroup>
110+
<ItemGroup>
111+
<PackageReference Include="Microsoft.Identity.Client">
112+
<Version>4.1.0</Version>
113+
</PackageReference>
114+
<PackageReference Include="Newtonsoft.Json">
115+
<Version>11.0.2</Version>
116+
</PackageReference>
117+
</ItemGroup>
119118
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
120119
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
121120
Other similar extension points exist, see Microsoft.Common.targets.

1. Desktop app calls Web API/TodoListClient/packages.config

Lines changed: 0 additions & 5 deletions
This file was deleted.

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)

2. Web API now calls Microsoft Graph/TodoListClient/TodoListClient.csproj

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,6 @@
3636
<WarningLevel>4</WarningLevel>
3737
</PropertyGroup>
3838
<ItemGroup>
39-
<Reference Include="Microsoft.Identity.Client, Version=4.0.0.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae, processorArchitecture=MSIL">
40-
<HintPath>..\packages\Microsoft.Identity.Client.4.0.0\lib\net45\Microsoft.Identity.Client.dll</HintPath>
41-
</Reference>
42-
<Reference Include="Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
43-
<HintPath>..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
44-
</Reference>
4539
<Reference Include="System" />
4640
<Reference Include="System.Configuration" />
4741
<Reference Include="System.Data" />
@@ -102,9 +96,6 @@
10296
<Generator>ResXFileCodeGenerator</Generator>
10397
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
10498
</EmbeddedResource>
105-
<None Include="packages.config">
106-
<SubType>Designer</SubType>
107-
</None>
10899
<None Include="Properties\Settings.settings">
109100
<Generator>SettingsSingleFileGenerator</Generator>
110101
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
@@ -116,6 +107,14 @@
116107
<SubType>Designer</SubType>
117108
</None>
118109
</ItemGroup>
110+
<ItemGroup>
111+
<PackageReference Include="Microsoft.Identity.Client">
112+
<Version>4.1.0</Version>
113+
</PackageReference>
114+
<PackageReference Include="Newtonsoft.Json">
115+
<Version>11.0.2</Version>
116+
</PackageReference>
117+
</ItemGroup>
119118
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
120119
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
121120
Other similar extension points exist, see Microsoft.Common.targets.

2. Web API now calls Microsoft Graph/TodoListClient/packages.config

Lines changed: 0 additions & 5 deletions
This file was deleted.

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)