Skip to content

Commit fcc98f5

Browse files
jennyf19eerhardtdotnet-maestro[bot]
authored
Update Microsoft.Identity.Model to 7.0.0-preview3 (#50218)
* Update Microsoft.Identity.Model to 7.0.0-preview3 * fixing null refs in WsFed * Add link to tracking issue. * Add link to tracking issue. * Update dependencies from https://github.com/dotnet/source-build-externals build 20230824.1 Microsoft.SourceBuild.Intermediate.source-build-externals From Version 8.0.0-alpha.1.23421.1 -> To Version 8.0.0-alpha.1.23424.1 * Workaround AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#2261 in a test. --------- Co-authored-by: Eric Erhardt <[email protected]> Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
1 parent e0e74ad commit fcc98f5

File tree

4 files changed

+24
-22
lines changed

4 files changed

+24
-22
lines changed

eng/Version.Details.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,9 @@
189189
<Uri>https://github.com/dotnet/runtime</Uri>
190190
<Sha>ba6a4adb228567a6bb3f4a9e5789fb74c47c8c94</Sha>
191191
</Dependency>
192-
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-externals" Version="8.0.0-alpha.1.23421.1">
192+
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-externals" Version="8.0.0-alpha.1.23424.1">
193193
<Uri>https://github.com/dotnet/source-build-externals</Uri>
194-
<Sha>1bc73adce07951fc0931ebd2b93492db78c538df</Sha>
194+
<Sha>e3cc6c792114ebdfe6627742d2820dbe1ae5bc47</Sha>
195195
<SourceBuild RepoName="source-build-externals" ManagedOnly="true" />
196196
</Dependency>
197197
<Dependency Name="Microsoft.SourceBuild.Intermediate.symreader" Version="2.0.0-beta-23228-03">

eng/Versions.props

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<AspNetCorePatchVersion>0</AspNetCorePatchVersion>
1212
<PreReleaseVersionIteration>2</PreReleaseVersionIteration>
1313
<ValidateBaseline>true</ValidateBaseline>
14-
<IdentityModelVersion>7.0.0-preview</IdentityModelVersion>
14+
<IdentityModelVersion>7.0.0-preview3</IdentityModelVersion>
1515
<!--
1616
When StabilizePackageVersion is set to 'true', this branch will produce stable outputs for 'Shipping' packages
1717
-->
@@ -162,7 +162,7 @@
162162
<MicrosoftDotNetBuildTasksTemplatingVersion>8.0.0-beta.23419.1</MicrosoftDotNetBuildTasksTemplatingVersion>
163163
<MicrosoftDotNetRemoteExecutorVersion>8.0.0-beta.23419.1</MicrosoftDotNetRemoteExecutorVersion>
164164
<!-- Packages from dotnet/source-build-externals -->
165-
<MicrosoftSourceBuildIntermediatesourcebuildexternalsVersion>8.0.0-alpha.1.23421.1</MicrosoftSourceBuildIntermediatesourcebuildexternalsVersion>
165+
<MicrosoftSourceBuildIntermediatesourcebuildexternalsVersion>8.0.0-alpha.1.23424.1</MicrosoftSourceBuildIntermediatesourcebuildexternalsVersion>
166166
<!-- Packages from dotnet/source-build-reference-packages -->
167167
<MicrosoftSourceBuildIntermediatesourcebuildreferencepackagesVersion>8.0.0-alpha.1.23424.1</MicrosoftSourceBuildIntermediatesourcebuildreferencepackagesVersion>
168168
<!-- Packages from dotnet/symreader -->

src/Security/Authentication/WsFederation/src/WsFederationHandler.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ protected override async Task HandleChallengeAsync(AuthenticationProperties prop
9898
var wsFederationMessage = new WsFederationMessage()
9999
{
100100
IssuerAddress = _configuration.TokenEndpoint ?? string.Empty,
101-
Wtrealm = Options.Wtrealm,
101+
Wtrealm = Options.Wtrealm!, // TODO: https://github.com/dotnet/aspnetcore/issues/50242
102102
Wa = WsFederationConstants.WsFederationActions.SignIn,
103103
};
104104

@@ -195,7 +195,7 @@ protected override async Task<HandleRequestResult> HandleRemoteAuthenticateAsync
195195
{
196196
// Extract the user state from properties and reset.
197197
properties.Items.TryGetValue(WsFederationDefaults.UserstatePropertiesKey, out var userState);
198-
wsFederationMessage.Wctx = userState;
198+
wsFederationMessage.Wctx = userState!; // TODO: '!' can be removed with https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/issues/2240
199199
}
200200

201201
var messageReceivedContext = new MessageReceivedContext(Context, Scheme, Options, properties)
@@ -425,7 +425,7 @@ public virtual async Task SignOutAsync(AuthenticationProperties? properties)
425425
var wsFederationMessage = new WsFederationMessage()
426426
{
427427
IssuerAddress = _configuration.TokenEndpoint ?? string.Empty,
428-
Wtrealm = Options.Wtrealm,
428+
Wtrealm = Options.Wtrealm!, // TODO: https://github.com/dotnet/aspnetcore/issues/50242
429429
Wa = WsFederationConstants.WsFederationActions.SignOut,
430430
};
431431

src/Security/Authentication/test/JwtBearerTests_Handler.cs

+17-15
Original file line numberDiff line numberDiff line change
@@ -914,21 +914,23 @@ public async Task ExpirationAndIssuedSetOnAuthenticateResult()
914914
public async Task ExpirationAndIssuedWhenMinOrMaxValue()
915915
{
916916
var key = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(new string('a', 128)));
917-
var creds = new SigningCredentials(key, SecurityAlgorithms.HmacSha256);
918-
919-
var claims = new[]
920-
{
921-
new Claim(ClaimTypes.NameIdentifier, "Bob")
922-
};
923-
924-
var token = new JwtSecurityToken(
925-
issuer: "issuer.contoso.com",
926-
audience: "audience.contoso.com",
927-
claims: claims,
928-
expires: DateTime.MaxValue,
929-
signingCredentials: creds);
930-
931-
var tokenText = new JwtSecurityTokenHandler().WriteToken(token);
917+
//var creds = new SigningCredentials(key, SecurityAlgorithms.HmacSha256);
918+
919+
//var claims = new[]
920+
//{
921+
// new Claim(ClaimTypes.NameIdentifier, "Bob")
922+
//};
923+
924+
//var token = new JwtSecurityToken(
925+
// issuer: "issuer.contoso.com",
926+
// audience: "audience.contoso.com",
927+
// claims: claims,
928+
// expires: DateTime.MaxValue,
929+
// signingCredentials: creds);
930+
931+
//var tokenText = new JwtSecurityTokenHandler().WriteToken(token);
932+
// 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
933+
var tokenText = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1laWRlbnRpZmllciI6IkJvYiIsImV4cCI6MjUzNDAyMzAwODAwLCJpc3MiOiJpc3N1ZXIuY29udG9zby5jb20iLCJhdWQiOiJhdWRpZW5jZS5jb250b3NvLmNvbSJ9.0zvasyAh-GmjR_o46QSRCoQ9VaSXJjW5_YMcR6qy-jw";
932934

933935
using var host = await CreateHost(o =>
934936
{

0 commit comments

Comments
 (0)