Fix for #2371#2374
Merged
Merged
Conversation
In .NET 5+, we now use the DefaultTokenAcquisitionHost (the host for SDK apps) instead of the Asp.NET core one, when the service collection was not initialized by ASP.NET Core (that is the `IWebHostEnvironment` is not present in the collection. If developers want the ASP.NET Core host, they would need to use the WebApplication.CreateBuilder().Services instead of instanciating a simple service collection.
MZOLN
reviewed
Aug 10, 2023
| } | ||
|
|
||
| [Fact] | ||
| public void TokenAcquirerFactoryDoesNotUseAspNetCoreHost() |
Contributor
There was a problem hiding this comment.
This test project only tests NET7.0 and NET8.0 it will never test netstandard, which is part of the change.
Would it make sense to add netstandard as part of the target to the test project?
Collaborator
Author
There was a problem hiding this comment.
No longer needed with the fix
Contributor
There was a problem hiding this comment.
Well we should still test the whole library for netstandard2.0 dont you think? It`s a release target after all.
- Adds a PrincipalExtensionsForSecurityTokens.GetBootstrapToken method that extracts a Security token from the bootstrap context (+unit tests) - In Web APIs, GetAuthenticationResultForUserAsync tries the BootstrapContext first
jennyf19
reviewed
Aug 13, 2023
jennyf19
reviewed
Aug 13, 2023
jennyf19
reviewed
Aug 13, 2023
jennyf19
reviewed
Aug 13, 2023
- Supports extended strings (StringsValues) as the BootstrapContext
…sForSecurityTokens.cs Co-authored-by: jennyf19 <jeferrie@microsoft.com>
…ft-identity-web into jmprieur/Fix2371
…sForSecurityTokens.cs Co-authored-by: jennyf19 <jeferrie@microsoft.com>
…tyTokensTests.cs Co-authored-by: jennyf19 <jeferrie@microsoft.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix for #2371
Description
In .NET 5+, we now use the DefaultTokenAcquisitionHost (the host for SDK apps) instead of the Asp.NET core one, when the service collection was not initialized by ASP.NET Core (that is the
IWebHostEnvironmentis not present in the collection.If developers want the ASP.NET Core host, they would need to use the WebApplication.CreateBuilder().Services instead of instanciating a simple service collection.
Fixes #2371