-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Conversation
Hi @jzheaux, could you take a look at this fix? |
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.
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); |
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.
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
Sure, let me take a look once |
Hi, @Anubhav-2000! Are you able to make the requested changes? |
Hi @jzheaux ! May I follow up on this according to your feedback ? |
Filed #14743, wonder if you guys could help take a look |
Thanks, @Anubhav-2000 for getting things started! @youngkih was able to finish in a separate PR. I'm closing this in favor of #14743 |
Fixes #11725
Please let me know if i have implemented something incorrectly. First time submitting a PR for bug fix :)