Skip to content

Commit d6250f6

Browse files
authored
Fixes #2521 (#2522)
1 parent d98c896 commit d6250f6

File tree

5 files changed

+7
-86
lines changed

5 files changed

+7
-86
lines changed

tests/IntegrationTests/SimulateOidc/Contollers/MetadataController.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License.
33

4+
using System.Text;
45
using Microsoft.AspNetCore.Authorization;
56
using Microsoft.AspNetCore.Mvc;
67

@@ -33,10 +34,13 @@ public IActionResult OpenIdConnectConfiguration()
3334
}
3435

3536
[HttpGet("/v2.0/.well-known/keys.json")]
36-
public IActionResult Keys()
37+
public async Task<IActionResult> Keys()
3738
{
38-
byte[] keysDocument = Properties.Resource.keys;
39-
return new FileContentResult(keysDocument, "application/json");
39+
HttpClient client = new HttpClient();
40+
string keysDocument = await client.GetStringAsync("https://login.microsoftonline.com/common/discovery/v2.0/keys").ConfigureAwait(false);
41+
keysDocument = keysDocument.Replace("https://login.microsoftonline.com/{tenantid}/v2.0", "invalidIssuer", StringComparison.OrdinalIgnoreCase);
42+
// byte[] keysDocument = Properties.Resource.keys;
43+
return new FileContentResult(Encoding.ASCII.GetBytes(keysDocument), "application/json");
4044
}
4145
}
4246
}

tests/IntegrationTests/SimulateOidc/Properties/Resource.Designer.cs

Lines changed: 0 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/IntegrationTests/SimulateOidc/Properties/Resource.resx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,6 @@
118118
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119119
</resheader>
120120
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
121-
<data name="keys" type="System.Resources.ResXFileRef, System.Windows.Forms">
122-
<value>keys.json;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
123-
</data>
124121
<data name="openid_configuration" type="System.Resources.ResXFileRef, System.Windows.Forms">
125122
<value>openid-configuration;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
126123
</data>

tests/IntegrationTests/SimulateOidc/Properties/keys.json

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

tests/IntegrationTests/SimulateOidc/SimulateOidc.csproj

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,6 @@
2424
</Compile>
2525
</ItemGroup>
2626

27-
<ItemGroup>
28-
<Content Update="Properties\keys.json">
29-
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
30-
</Content>
31-
</ItemGroup>
32-
3327
<ItemGroup>
3428
<EmbeddedResource Update="Properties\Resource.resx">
3529
<LastGenOutput>Resource.Designer.cs</LastGenOutput>

0 commit comments

Comments
 (0)