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 a6d48977159e..7eac5625b697 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -11,7 +11,7 @@ 0 2 true - 7.0.0-preview4 + 7.0.0-preview5 @@ -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 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]