Skip to content

Commit

Permalink
Fixes 2737 (#2738)
Browse files Browse the repository at this point in the history
* Fixes 2737

* switch someaddress.com with 127.0.0.1

---------

Co-authored-by: id4s <user@contoso.com>
  • Loading branch information
jmprieur and HP712 authored Jul 22, 2024
1 parent 49a3a95 commit ec39ddb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ internal async ValueTask<TokenValidationResult> ValidateJWEAsync(
{
try
{
TokenValidationResult tokenValidationResult = ReadToken(DecryptToken(jwtToken, validationParameters), validationParameters);
TokenValidationResult tokenValidationResult = ReadToken(DecryptToken(jwtToken, validationParameters, configuration), validationParameters);
if (!tokenValidationResult.IsValid)
return tokenValidationResult;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ public void GetConfiguration()
context.Diffs.Add("!object.ReferenceEquals(configuration, configuration2)");

// get configuration from http address, should throw
configManager = new ConfigurationManager<OpenIdConnectConfiguration>("http://someaddress.com", new OpenIdConnectConfigurationRetriever());
configManager = new ConfigurationManager<OpenIdConnectConfiguration>("http://127.0.0.1", new OpenIdConnectConfigurationRetriever());
var ee = new ExpectedException(typeof(InvalidOperationException), "IDX20803:", typeof(ArgumentException));
try
{
Expand All @@ -397,7 +397,7 @@ public void GetConfiguration()
}

// get configuration from https address, should throw
configManager = new ConfigurationManager<OpenIdConnectConfiguration>("https://someaddress.com", new OpenIdConnectConfigurationRetriever());
configManager = new ConfigurationManager<OpenIdConnectConfiguration>("https://127.0.0.1", new OpenIdConnectConfigurationRetriever());
ee = new ExpectedException(typeof(InvalidOperationException), "IDX20803:", typeof(IOException));
try
{
Expand Down Expand Up @@ -441,7 +441,7 @@ public void GetConfiguration()
configuration = configManager.GetConfigurationAsync().Result;
TestUtilities.SetField(configManager, "_lastRefresh", DateTimeOffset.UtcNow - TimeSpan.FromHours(1));
configManager.RequestRefresh();
configManager.MetadataAddress = "http://someaddress.com";
configManager.MetadataAddress = "http://127.0.0.1";
configuration2 = configManager.GetConfigurationAsync().Result;
IdentityComparer.AreEqual(configuration, configuration2, context);
if (!object.ReferenceEquals(configuration, configuration2))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public void GetSets()
new KeyValuePair<string, List<object>>("ActorValidationParameters", new List<object>{(TokenValidationParameters)null, new TokenValidationParameters(), new TokenValidationParameters()}),
new KeyValuePair<string, List<object>>("AuthenticationType", new List<object>{(string)null, Guid.NewGuid().ToString(), Guid.NewGuid().ToString()}),
new KeyValuePair<string, List<object>>("ClockSkew", new List<object>{TokenValidationParameters.DefaultClockSkew, TimeSpan.FromHours(2), TimeSpan.FromMinutes(1)}),
new KeyValuePair<string, List<object>>("ConfigurationManager", new List<object>{(BaseConfigurationManager)null, new ConfigurationManager<OpenIdConnectConfiguration>("http://someaddress.com", new OpenIdConnectConfigurationRetriever()), new ConfigurationManager<WsFederationConfiguration>("http://someaddress.com", new WsFederationConfigurationRetriever()) }),
new KeyValuePair<string, List<object>>("ConfigurationManager", new List<object>{(BaseConfigurationManager)null, new ConfigurationManager<OpenIdConnectConfiguration>("http://127.0.0.1", new OpenIdConnectConfigurationRetriever()), new ConfigurationManager<WsFederationConfiguration>("http://127.0.0.1", new WsFederationConfigurationRetriever()) }),
new KeyValuePair<string, List<object>>("CryptoProviderFactory", new List<object>{(CryptoProviderFactory)null, new CryptoProviderFactory(), new CryptoProviderFactory() }),
new KeyValuePair<string, List<object>>("DebugId", new List<object>{(string)null, "DebugId", "DebugId" }),
new KeyValuePair<string, List<object>>("IgnoreTrailingSlashWhenValidatingAudience", new List<object>{true, false, true}),
Expand Down

0 comments on commit ec39ddb

Please sign in to comment.