Skip to content

Commit

Permalink
Update Microsoft.IdentityModel to 7.0.0-preview5 (#50538)
Browse files Browse the repository at this point in the history
* Update Microsoft.IdentityModel to 7.0.0-preview

* Update test to account for bug fix in AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#2283.

* 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

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
  • Loading branch information
eerhardt and dotnet-maestro[bot] committed Sep 7, 2023
1 parent 415e7f7 commit f8cdb58
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
4 changes: 2 additions & 2 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>1222f14d02818cfab597fa2a17c8664fe6cb39be</Sha>
</Dependency>
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-externals" Version="8.0.0-alpha.1.23455.1">
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-externals" Version="8.0.0-alpha.1.23456.1">
<Uri>https://github.com/dotnet/source-build-externals</Uri>
<Sha>80d1c9575b8e2a3c4244fe042e3ee2b662b22ebe</Sha>
<Sha>1b64d3c0fad8af67da8f42927ce7306730224c15</Sha>
<SourceBuild RepoName="source-build-externals" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.SourceBuild.Intermediate.symreader" Version="2.0.0-beta-23228-03">
Expand Down
4 changes: 2 additions & 2 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<AspNetCorePatchVersion>0</AspNetCorePatchVersion>
<PreReleaseVersionIteration>2</PreReleaseVersionIteration>
<ValidateBaseline>true</ValidateBaseline>
<IdentityModelVersion>7.0.0-preview4</IdentityModelVersion>
<IdentityModelVersion>7.0.0-preview5</IdentityModelVersion>
<!--
When StabilizePackageVersion is set to 'true', this branch will produce stable outputs for 'Shipping' packages
-->
Expand Down Expand Up @@ -162,7 +162,7 @@
<MicrosoftDotNetBuildTasksTemplatingVersion>8.0.0-beta.23451.1</MicrosoftDotNetBuildTasksTemplatingVersion>
<MicrosoftDotNetRemoteExecutorVersion>8.0.0-beta.23451.1</MicrosoftDotNetRemoteExecutorVersion>
<!-- Packages from dotnet/source-build-externals -->
<MicrosoftSourceBuildIntermediatesourcebuildexternalsVersion>8.0.0-alpha.1.23455.1</MicrosoftSourceBuildIntermediatesourcebuildexternalsVersion>
<MicrosoftSourceBuildIntermediatesourcebuildexternalsVersion>8.0.0-alpha.1.23456.1</MicrosoftSourceBuildIntermediatesourcebuildexternalsVersion>
<!-- Packages from dotnet/source-build-reference-packages -->
<MicrosoftSourceBuildIntermediatesourcebuildreferencepackagesVersion>8.0.0-alpha.1.23455.3</MicrosoftSourceBuildIntermediatesourcebuildreferencepackagesVersion>
<!-- Packages from dotnet/symreader -->
Expand Down
19 changes: 15 additions & 4 deletions src/Security/Authentication/test/JwtBearerTests.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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]
Expand Down

0 comments on commit f8cdb58

Please sign in to comment.