-
Notifications
You must be signed in to change notification settings - Fork 432
Allow usage of relative URIs in AuthnContextClassRef #3281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Allow usage of relative URIs in AuthnContextClassRef #3281
Conversation
.../Microsoft.IdentityModel.Tokens.Saml.Tests/Saml2AuthenticationContextCollectionDefinition.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
Co-authored-by: Peter <[email protected]>
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? |
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