-
Notifications
You must be signed in to change notification settings - Fork 413
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
Fetch configuration when validating SAML issuer and signature #2412
Conversation
This is already done in the JwtSecurityTokenHandler and the semantics should be similar. This caused a regression in Microsoft.AspNetCore.Authentication.WsFederation.WsFederationHandler which assumes the token handler will fetch the current configuration as part of the token validation if the ConfigurationManager is a subclass of BaseConfigurationManager. This change makes the SamlSecurityTokenHandler and Saml2SecurityTokenHandler equal to the JwtSecurityTokenHandler with regards to fetching the configuration before validation.
src/Microsoft.IdentityModel.Tokens.Saml/Saml/SamlSecurityTokenHandler.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.IdentityModel.Tokens.Saml/Saml/SamlSecurityTokenHandler.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.IdentityModel.Tokens.Saml/Saml2/Saml2SecurityTokenHandler.cs
Show resolved
Hide resolved
@microsoft-github-policy-service agree company="Frende" |
Refactor PopulateValidationParametersWithCurrentConfigurationAsync null check to guard with an early return. Rename cloned variable to make code easier to read.
Refactor PopulateValidationParametersWithCurrentConfigurationAsync null check to guard with an early return. Rename cloned variable to make code easier to read.
@microsoft-github-policy-service agree company="Frende" |
Do you need anything more from me on this issue? |
src/Microsoft.IdentityModel.Tokens.Saml/Saml2/Saml2SecurityTokenHandler.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.IdentityModel.Tokens.Saml/Saml2/Saml2SecurityTokenHandler.cs
Outdated
Show resolved
Hide resolved
test/Microsoft.IdentityModel.Tokens.Saml.Tests/Saml2SecurityTokenHandlerTests.cs
Show resolved
Hide resolved
@Hakon will you be continuing work on this PR? Please see above comments from @brentschmaltz thank you. |
I will, it's just a bit busy period for me. If someone else want to continue this work I'm open to share :) |
… a shared utility class
Issuer set, Key set, Issuer and key set and nothing set
I implemented the changes mentioned, could you take another look? |
Fetch configuration when validating SAML issuer and signature
Fetch configuration on token validation for SAML in the same way as JwtSecurityTokenHandler
Description
This is already done in the JwtSecurityTokenHandler and the semantics should be similar.
This caused a regression in Microsoft.AspNetCore.Authentication.WsFederation.WsFederationHandler which assumes the token handler will fetch the current configuration as part of the token validation if the ConfigurationManager is a subclass of BaseConfigurationManager.
This change makes the SamlSecurityTokenHandler and Saml2SecurityTokenHandler semantics equal to the JwtSecurityTokenHandler with regards to fetching the configuration before validation.
This discrepancy allowed the following bug to appear in Microsoft.AspNetCore.Authentication.WsFederation.WsFederationHandler.
Fixes #2406