зеркало из https://github.com/dotnet/aspnetcore.git
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 https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/issues/2261 in a test. --------- Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com> Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
This commit is contained in:
Родитель
e0e74adca3
Коммит
fcc98f5c65
|
@ -189,9 +189,9 @@
|
|||
<Uri>https://github.com/dotnet/runtime</Uri>
|
||||
<Sha>ba6a4adb228567a6bb3f4a9e5789fb74c47c8c94</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-externals" Version="8.0.0-alpha.1.23421.1">
|
||||
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-externals" Version="8.0.0-alpha.1.23424.1">
|
||||
<Uri>https://github.com/dotnet/source-build-externals</Uri>
|
||||
<Sha>1bc73adce07951fc0931ebd2b93492db78c538df</Sha>
|
||||
<Sha>e3cc6c792114ebdfe6627742d2820dbe1ae5bc47</Sha>
|
||||
<SourceBuild RepoName="source-build-externals" ManagedOnly="true" />
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.SourceBuild.Intermediate.symreader" Version="2.0.0-beta-23228-03">
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<AspNetCorePatchVersion>0</AspNetCorePatchVersion>
|
||||
<PreReleaseVersionIteration>2</PreReleaseVersionIteration>
|
||||
<ValidateBaseline>true</ValidateBaseline>
|
||||
<IdentityModelVersion>7.0.0-preview</IdentityModelVersion>
|
||||
<IdentityModelVersion>7.0.0-preview3</IdentityModelVersion>
|
||||
<!--
|
||||
When StabilizePackageVersion is set to 'true', this branch will produce stable outputs for 'Shipping' packages
|
||||
-->
|
||||
|
@ -162,7 +162,7 @@
|
|||
<MicrosoftDotNetBuildTasksTemplatingVersion>8.0.0-beta.23419.1</MicrosoftDotNetBuildTasksTemplatingVersion>
|
||||
<MicrosoftDotNetRemoteExecutorVersion>8.0.0-beta.23419.1</MicrosoftDotNetRemoteExecutorVersion>
|
||||
<!-- Packages from dotnet/source-build-externals -->
|
||||
<MicrosoftSourceBuildIntermediatesourcebuildexternalsVersion>8.0.0-alpha.1.23421.1</MicrosoftSourceBuildIntermediatesourcebuildexternalsVersion>
|
||||
<MicrosoftSourceBuildIntermediatesourcebuildexternalsVersion>8.0.0-alpha.1.23424.1</MicrosoftSourceBuildIntermediatesourcebuildexternalsVersion>
|
||||
<!-- Packages from dotnet/source-build-reference-packages -->
|
||||
<MicrosoftSourceBuildIntermediatesourcebuildreferencepackagesVersion>8.0.0-alpha.1.23424.1</MicrosoftSourceBuildIntermediatesourcebuildreferencepackagesVersion>
|
||||
<!-- Packages from dotnet/symreader -->
|
||||
|
|
|
@ -98,7 +98,7 @@ public class WsFederationHandler : RemoteAuthenticationHandler<WsFederationOptio
|
|||
var wsFederationMessage = new WsFederationMessage()
|
||||
{
|
||||
IssuerAddress = _configuration.TokenEndpoint ?? string.Empty,
|
||||
Wtrealm = Options.Wtrealm,
|
||||
Wtrealm = Options.Wtrealm!, // TODO: https://github.com/dotnet/aspnetcore/issues/50242
|
||||
Wa = WsFederationConstants.WsFederationActions.SignIn,
|
||||
};
|
||||
|
||||
|
@ -195,7 +195,7 @@ public class WsFederationHandler : RemoteAuthenticationHandler<WsFederationOptio
|
|||
{
|
||||
// Extract the user state from properties and reset.
|
||||
properties.Items.TryGetValue(WsFederationDefaults.UserstatePropertiesKey, out var userState);
|
||||
wsFederationMessage.Wctx = userState;
|
||||
wsFederationMessage.Wctx = userState!; // TODO: '!' can be removed with https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/issues/2240
|
||||
}
|
||||
|
||||
var messageReceivedContext = new MessageReceivedContext(Context, Scheme, Options, properties)
|
||||
|
@ -425,7 +425,7 @@ public class WsFederationHandler : RemoteAuthenticationHandler<WsFederationOptio
|
|||
var wsFederationMessage = new WsFederationMessage()
|
||||
{
|
||||
IssuerAddress = _configuration.TokenEndpoint ?? string.Empty,
|
||||
Wtrealm = Options.Wtrealm,
|
||||
Wtrealm = Options.Wtrealm!, // TODO: https://github.com/dotnet/aspnetcore/issues/50242
|
||||
Wa = WsFederationConstants.WsFederationActions.SignOut,
|
||||
};
|
||||
|
||||
|
|
|
@ -914,21 +914,23 @@ public class JwtBearerTests_Handler : SharedAuthenticationTests<JwtBearerOptions
|
|||
public async Task ExpirationAndIssuedWhenMinOrMaxValue()
|
||||
{
|
||||
var key = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(new string('a', 128)));
|
||||
var creds = new SigningCredentials(key, SecurityAlgorithms.HmacSha256);
|
||||
//var creds = new SigningCredentials(key, SecurityAlgorithms.HmacSha256);
|
||||
|
||||
var claims = new[]
|
||||
{
|
||||
new Claim(ClaimTypes.NameIdentifier, "Bob")
|
||||
};
|
||||
//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 token = new JwtSecurityToken(
|
||||
// issuer: "issuer.contoso.com",
|
||||
// audience: "audience.contoso.com",
|
||||
// claims: claims,
|
||||
// expires: DateTime.MaxValue,
|
||||
// signingCredentials: creds);
|
||||
|
||||
var tokenText = new JwtSecurityTokenHandler().WriteToken(token);
|
||||
//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";
|
||||
|
||||
using var host = await CreateHost(o =>
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче