Skip to content

Commit

Permalink
Fixes #2521 (#2522)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmprieur authored Oct 16, 2023
1 parent d98c896 commit d6250f6
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 86 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System.Text;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;

Expand Down Expand Up @@ -33,10 +34,13 @@ public IActionResult OpenIdConnectConfiguration()
}

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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions tests/IntegrationTests/SimulateOidc/Properties/Resource.resx
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,6 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="keys" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>keys.json;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="openid_configuration" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>openid-configuration;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
Expand Down
64 changes: 0 additions & 64 deletions tests/IntegrationTests/SimulateOidc/Properties/keys.json

This file was deleted.

6 changes: 0 additions & 6 deletions tests/IntegrationTests/SimulateOidc/SimulateOidc.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@
</Compile>
</ItemGroup>

<ItemGroup>
<Content Update="Properties\keys.json">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</Content>
</ItemGroup>

<ItemGroup>
<EmbeddedResource Update="Properties\Resource.resx">
<LastGenOutput>Resource.Designer.cs</LastGenOutput>
Expand Down

0 comments on commit d6250f6

Please sign in to comment.