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

Added support to display child status codes if they exist in SAML response #12818

Closed
wants to merge 7 commits into from

Conversation

Anubhav-2000
Copy link
Contributor

Fixes #11725
Please let me know if i have implemented something incorrectly. First time submitting a PR for bug fix :)

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Mar 2, 2023
@Anubhav-2000 Anubhav-2000 marked this pull request as ready for review March 2, 2023 19:34
@Anubhav-2000
Copy link
Contributor Author

Hi @jzheaux, could you take a look at this fix?

Copy link
Contributor

@jzheaux jzheaux left a comment

Choose a reason for hiding this comment

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

Thanks, @Anubhav-2000! Sorry for the delay in responding. I've left some inline feedback.

Also, will you please add a test that confirms the error message includes a child status code?

When you are ready, please squash your commits so that there is only one.

String message = String.format("Invalid status [%s] for SAML response [%s]", statusCode,
response.getID());
result = result.concat(new Saml2Error(Saml2ErrorCodes.INVALID_RESPONSE, message));
List<String> statusCodes = getStatusCodes(response);
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of getting all the status codes ad infinitum, please just get the top-level one.

If it is of type REQUESTER, RESPONDER, or VERSION_MISMATCH, then add a single error message that includes this status code and any single child status code.

Otherwise, if it isn't SUCCESS, then add a single error message like it already does.

This is based on the logic outlined in: https://docs.oasis-open.org/security/saml/v2.0/saml-core-2.0-os.pdf#page=39

@jzheaux jzheaux self-assigned this Aug 28, 2023
@jzheaux jzheaux added type: enhancement A general enhancement in: saml2 An issue in SAML2 modules and removed status: waiting-for-triage An issue we've not yet triaged labels Aug 28, 2023
@Anubhav-2000
Copy link
Contributor Author

Sure, let me take a look once

@jzheaux
Copy link
Contributor

jzheaux commented Oct 3, 2023

Hi, @Anubhav-2000! Are you able to make the requested changes?

@jzheaux jzheaux added the status: ideal-for-contribution An issue that we actively are looking for someone to help us with label Dec 8, 2023
@jzheaux jzheaux removed their assignment Dec 8, 2023
@youngkih
Copy link
Contributor

Hi @jzheaux ! May I follow up on this according to your feedback ?

@youngkih
Copy link
Contributor

Filed #14743, wonder if you guys could help take a look

@jzheaux jzheaux added status: duplicate A duplicate of another issue and removed status: ideal-for-contribution An issue that we actively are looking for someone to help us with labels Mar 22, 2024
@jzheaux jzheaux self-assigned this Mar 22, 2024
@jzheaux
Copy link
Contributor

jzheaux commented Mar 22, 2024

Thanks, @Anubhav-2000 for getting things started! @youngkih was able to finish in a separate PR. I'm closing this in favor of #14743

@jzheaux jzheaux closed this Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: saml2 An issue in SAML2 modules status: duplicate A duplicate of another issue type: enhancement A general enhancement
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

OpenSaml4AuthenticationProvider should include secondary statusCode messages on error
4 participants