Skip to content
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

Add Tests for Lifetime Validation Using New Validation Model For SAML2 #2906

Merged
merged 2 commits into from
Oct 16, 2024

Conversation

FuPingFranco
Copy link
Contributor

@FuPingFranco FuPingFranco commented Oct 15, 2024

Add Tests for Lifetime Validation Using New Validation Model For SAML2

Description

Adding tests validating lifetime for new implementation of ValidateTokenAsync for Saml2SecurityTokenHandler

Fixes #2906

@FuPingFranco FuPingFranco requested a review from a team as a code owner October 15, 2024 23:35
@FuPingFranco FuPingFranco changed the title Adding Test for Lifetime Validation Using New Validation Model For SAML2 Add Tests for Lifetime Validation Using New Validation Model For SAML2 Oct 16, 2024
Copy link
Contributor

@iNinja iNinja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

if (value.Value <= NotBefore.Value)
throw LogExceptionMessage(new ArgumentException(FormatInvariant(LogMessages.IDX13514, MarkAsNonPII(value), MarkAsNonPII(NotBefore))));
}
//This should not be checked here, instead fail during validation of the token. Will remove this code once we release new validation model bug #2905
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I usually find more clear the single line // comments as they are easier to know where they begin and end when looking at git history or PRs.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In bug #2905 can you make sure this is linked there?


Saml2SecurityTokenHandler saml2TokenHandler = new Saml2SecurityTokenHandler();

// Validate token using TokenValidationParameters
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Validate token using TokenValidationParameters
// Validate token using legacy TokenValidationParameters

Copy link
Collaborator

@jennyf19 jennyf19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@brentschmaltz brentschmaltz merged commit 5ac40df into dev Oct 16, 2024
6 checks passed
@FuPingFranco FuPingFranco self-assigned this Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants