Allow usage of relative URIs in AuthnContextClassRef#3281
Allow usage of relative URIs in AuthnContextClassRef#3281glatzert wants to merge 8 commits intoAzureAD:devfrom
Conversation
.../Microsoft.IdentityModel.Tokens.Saml.Tests/Saml2AuthenticationContextCollectionDefinition.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new AppContext switch to allow relative URIs in SAML2 AuthnContextClassRef elements. Currently, the library enforces that ClassReference values must be absolute URIs, but this change provides a configuration option to bypass this validation when needed.
- Adds a new AppContext switch
AllowRelativeUrisInSaml2AuthnContextto control URI validation behavior - Modifies the
Saml2AuthenticationContext.ClassReferencesetter to conditionally allow relative URIs - Includes comprehensive test coverage with proper test isolation through collection definitions
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
AppContextSwitches.cs |
Adds the new switch definition and reset logic |
Saml2AuthenticationContext.cs |
Updates ClassReference validation to respect the new switch |
Saml2AuthenticationContextWithAppContextTests.cs |
New test file to verify the switch functionality |
Saml2AuthenticationContextTests.cs |
Adds collection attribute for test isolation |
Saml2AuthenticationContextCollectionDefinition.cs |
Defines test collection with disabled parallelization |
src/Microsoft.IdentityModel.Tokens.Saml/Saml2/Saml2AuthenticationContext.cs
Outdated
Show resolved
Hide resolved
|
Once this is released, we'll need to update: https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/wiki/App-Context-Switches-in-IdentityModel |
…ionContext.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Peter <34331512+pmaytak@users.noreply.github.com>
80c3dc1 to
d494769
Compare
|
I updated the suggestions and rebased as per Githubs request - I hope I did not break anything in your workflow by doing that 🙈 I was sick last week, so I needed a liitle bit. |
|
Can I do something about the (probably) shared AppContext in the different dotnet versions or did i miss something in older .net runtimes? |
|
After being out-of-office for quite some time now, I wanted to follow up about this change - anything that can be done from my side to make it happen? |
Allow usage of relative URIs in AuthnContextClassRef
Introduces a AppContext switch, that allows to cirumvent a condition that checks for
Uri.IsAbsoulteonSaml2AuthenticationContext.ClassReferenceFixes #3279
@brentschmaltz