From 20d73ea52e277a1653873d67aa5c4828c70fdba8 Mon Sep 17 00:00:00 2001 From: Eric Erhardt Date: Tue, 5 Sep 2023 21:32:33 -0500 Subject: [PATCH 1/3] Update Microsoft.IdentityModel to 7.0.0-preview --- eng/Versions.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/Versions.props b/eng/Versions.props index a6d48977159e..8f69f92c7e3e 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -11,7 +11,7 @@ 0 2 true - 7.0.0-preview4 + 7.0.0-preview5 From f8b011afcf80f6a0da456a8a3c64a32391d6210e Mon Sep 17 00:00:00 2001 From: Eric Erhardt Date: Wed, 6 Sep 2023 10:07:41 -0500 Subject: [PATCH 2/3] Update test to account for bug fix in https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/2283. --- .../Authentication/test/JwtBearerTests.cs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/Security/Authentication/test/JwtBearerTests.cs b/src/Security/Authentication/test/JwtBearerTests.cs index 502afab2db02..bf63ccc7cbd1 100755 --- a/src/Security/Authentication/test/JwtBearerTests.cs +++ b/src/Security/Authentication/test/JwtBearerTests.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Globalization; using System.IdentityModel.Tokens.Jwt; using System.Net; using System.Net.Http; @@ -958,15 +959,15 @@ public async Task ExpirationAndIssuedSetOnAuthenticateResult() } [Fact] - public async Task ExpirationAndIssuedNullWhenMinOrMaxValue() + public async Task ExpirationAndIssuedWhenMinOrMaxValue() { var key = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(new string('a', 128))); var creds = new SigningCredentials(key, SecurityAlgorithms.HmacSha256); var claims = new[] { - new Claim(ClaimTypes.NameIdentifier, "Bob") - }; + new Claim(ClaimTypes.NameIdentifier, "Bob") + }; var token = new JwtSecurityToken( issuer: "issuer.contoso.com", @@ -995,8 +996,18 @@ public async Task ExpirationAndIssuedNullWhenMinOrMaxValue() Assert.Equal(HttpStatusCode.OK, response.Response.StatusCode); var responseBody = await response.Response.Content.ReadAsStringAsync(); using var dom = JsonDocument.Parse(responseBody); - Assert.Equal(JsonValueKind.Null, dom.RootElement.GetProperty("expires").ValueKind); Assert.Equal(JsonValueKind.Null, dom.RootElement.GetProperty("issued").ValueKind); + + var expiresElement = dom.RootElement.GetProperty("expires"); + Assert.Equal(JsonValueKind.String, expiresElement.ValueKind); + + var elementValue = DateTime.Parse(expiresElement.GetString(), CultureInfo.InvariantCulture); + var elementValueUtc = elementValue.ToUniversalTime(); + // roundtrip DateTime.MaxValue through parsing because it is lossy and we + // need equivalent values to compare against. + var max = DateTime.Parse(DateTime.MaxValue.ToString(CultureInfo.InvariantCulture), CultureInfo.InvariantCulture); + + Assert.Equal(max, elementValueUtc); } [Fact] From fb177da571dd64f38a526167b39d485b8b5e8a42 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Wed, 6 Sep 2023 13:42:45 +0000 Subject: [PATCH 3/3] Update dependencies from https://github.com/dotnet/source-build-externals build 20230906.1 Microsoft.SourceBuild.Intermediate.source-build-externals From Version 8.0.0-alpha.1.23455.1 -> To Version 8.0.0-alpha.1.23456.1 --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 4e4d70c2f1c2..75d3b82b9d9f 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -189,9 +189,9 @@ https://github.com/dotnet/runtime 3c48925a6c1ab31865b4438a6cb88242d1a8fe4d - + https://github.com/dotnet/source-build-externals - 80d1c9575b8e2a3c4244fe042e3ee2b662b22ebe + 1b64d3c0fad8af67da8f42927ce7306730224c15 diff --git a/eng/Versions.props b/eng/Versions.props index 8f69f92c7e3e..7eac5625b697 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -162,7 +162,7 @@ 8.0.0-beta.23451.1 8.0.0-beta.23451.1 - 8.0.0-alpha.1.23455.1 + 8.0.0-alpha.1.23456.1 8.0.0-alpha.1.23451.1