From 4edb646814a42bba1a43fd20a068e8a56e85aa6e Mon Sep 17 00:00:00 2001 From: Eric Erhardt Date: Tue, 29 Aug 2023 18:27:19 -0500 Subject: [PATCH 1/3] Update Microsoft.Identity.Model to 7.0.0-preview4 --- eng/Versions.props | 2 +- .../WsFederation/src/WsFederationHandler.cs | 6 ++-- .../test/JwtBearerTests_Handler.cs | 32 +++++++++---------- 3 files changed, 19 insertions(+), 21 deletions(-) diff --git a/eng/Versions.props b/eng/Versions.props index 864914d189af..676f6ec5ef98 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -11,7 +11,7 @@ 0 2 true - 7.0.0-preview3 + 7.0.0-preview4 diff --git a/src/Security/Authentication/WsFederation/src/WsFederationHandler.cs b/src/Security/Authentication/WsFederation/src/WsFederationHandler.cs index d336a8665a39..d00103ddb26a 100644 --- a/src/Security/Authentication/WsFederation/src/WsFederationHandler.cs +++ b/src/Security/Authentication/WsFederation/src/WsFederationHandler.cs @@ -98,7 +98,7 @@ protected override async Task HandleChallengeAsync(AuthenticationProperties prop var wsFederationMessage = new WsFederationMessage() { IssuerAddress = _configuration.TokenEndpoint ?? string.Empty, - Wtrealm = Options.Wtrealm!, // TODO: https://github.com/dotnet/aspnetcore/issues/50242 + Wtrealm = Options.Wtrealm, Wa = WsFederationConstants.WsFederationActions.SignIn, }; @@ -195,7 +195,7 @@ protected override async Task HandleRemoteAuthenticateAsync { // Extract the user state from properties and reset. properties.Items.TryGetValue(WsFederationDefaults.UserstatePropertiesKey, out var userState); - wsFederationMessage.Wctx = userState!; // TODO: '!' can be removed with https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/issues/2240 + wsFederationMessage.Wctx = userState; } var messageReceivedContext = new MessageReceivedContext(Context, Scheme, Options, properties) @@ -425,7 +425,7 @@ public virtual async Task SignOutAsync(AuthenticationProperties? properties) var wsFederationMessage = new WsFederationMessage() { IssuerAddress = _configuration.TokenEndpoint ?? string.Empty, - Wtrealm = Options.Wtrealm!, // TODO: https://github.com/dotnet/aspnetcore/issues/50242 + Wtrealm = Options.Wtrealm, Wa = WsFederationConstants.WsFederationActions.SignOut, }; diff --git a/src/Security/Authentication/test/JwtBearerTests_Handler.cs b/src/Security/Authentication/test/JwtBearerTests_Handler.cs index 0add4d39bb88..6d8260c2a39f 100644 --- a/src/Security/Authentication/test/JwtBearerTests_Handler.cs +++ b/src/Security/Authentication/test/JwtBearerTests_Handler.cs @@ -914,23 +914,21 @@ public async Task ExpirationAndIssuedSetOnAuthenticateResult() 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") - //}; - - //var token = new JwtSecurityToken( - // issuer: "issuer.contoso.com", - // audience: "audience.contoso.com", - // claims: claims, - // expires: DateTime.MaxValue, - // signingCredentials: creds); - - //var tokenText = new JwtSecurityTokenHandler().WriteToken(token); - // TODO: when https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/issues/2261 is fixed, uncomment the above code and remove this hard-coded string - var tokenText = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1laWRlbnRpZmllciI6IkJvYiIsImV4cCI6MjUzNDAyMzAwODAwLCJpc3MiOiJpc3N1ZXIuY29udG9zby5jb20iLCJhdWQiOiJhdWRpZW5jZS5jb250b3NvLmNvbSJ9.0zvasyAh-GmjR_o46QSRCoQ9VaSXJjW5_YMcR6qy-jw"; + var creds = new SigningCredentials(key, SecurityAlgorithms.HmacSha256); + + var claims = new[] + { + new Claim(ClaimTypes.NameIdentifier, "Bob") + }; + + var token = new JwtSecurityToken( + issuer: "issuer.contoso.com", + audience: "audience.contoso.com", + claims: claims, + expires: DateTime.MaxValue, + signingCredentials: creds); + + var tokenText = new JwtSecurityTokenHandler().WriteToken(token); using var host = await CreateHost(o => { From 13dd2f99ea80ea734d1b57be1d6248ddb2a178ad Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Wed, 30 Aug 2023 13:41:08 +0000 Subject: [PATCH 2/3] Update dependencies from https://github.com/dotnet/source-build-externals build 20230830.1 Microsoft.SourceBuild.Intermediate.source-build-externals From Version 8.0.0-alpha.1.23429.1 -> To Version 8.0.0-alpha.1.23430.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 23342c1f1f89..06a2ec832cfc 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -189,9 +189,9 @@ https://github.com/dotnet/runtime 4122c63a13cfe40e97ac1f9ef01d8110a66943f4 - + https://github.com/dotnet/source-build-externals - 0603839a51f5e18b89c60a3690aff5e81fa666ca + 5a51063272497101418a0bd272255f1b10e352c6 diff --git a/eng/Versions.props b/eng/Versions.props index 676f6ec5ef98..30d998608150 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -162,7 +162,7 @@ 8.0.0-beta.23419.1 8.0.0-beta.23419.1 - 8.0.0-alpha.1.23429.1 + 8.0.0-alpha.1.23430.1 8.0.0-alpha.1.23428.2 From d82729db27eeece26fe58934922b68dd139e7b7c Mon Sep 17 00:00:00 2001 From: Eric Erhardt Date: Wed, 30 Aug 2023 14:03:25 -0500 Subject: [PATCH 3/3] Update dependencies from https://github.com/dotnet/source-build-externals build 20230830.3 Microsoft.SourceBuild.Intermediate.source-build-externals From Version 8.0.0-alpha.1.23430.1 -> To Version 8.0.0-alpha.1.23430.3 --- 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 06a2ec832cfc..4b56816ee6c5 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -189,9 +189,9 @@ https://github.com/dotnet/runtime 4122c63a13cfe40e97ac1f9ef01d8110a66943f4 - + https://github.com/dotnet/source-build-externals - 5a51063272497101418a0bd272255f1b10e352c6 + c88d8d75ed6b8d426b7fad50eadd7f6fec46a7e4 diff --git a/eng/Versions.props b/eng/Versions.props index 30d998608150..dc22b2f7eb40 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -162,7 +162,7 @@ 8.0.0-beta.23419.1 8.0.0-beta.23419.1 - 8.0.0-alpha.1.23430.1 + 8.0.0-alpha.1.23430.3 8.0.0-alpha.1.23428.2