mbg / wai-saml2

WAI middleware implementing SAML2
MIT License
5 stars 6 forks source link

Return response' "InResponseTo" field from validation #33

Closed Philonous closed 1 year ago

Philonous commented 1 year ago

This PR adds support for InResponseTo in Response elements

According to saml-core [1]:

InResponseTo [Optional] A reference to the identifier of the request to which the response corresponds, if any. If the response is not generated in response to a request, or if the ID attribute value of a request cannot be determined (for example, the request is malformed), then this attribute MUST NOT be present. Otherwise, it MUST be present and its value MUST match the value of the corresponding request's ID attribute.

Also compare this stack exchange post [2] which argues that this value should be validated

I don't think this validation has to happen within this library, but it should be returned so that callers of the library can implement it themselves, similar to how checks for duplicate assertionId are left as an exercise to the reader :sweat_smile:

Checklist

Philonous commented 1 year ago

Fixed the failing tests

Philonous commented 1 year ago

I think I've addressed all the comments in new requests and I've re-based the PR onto master.

mbg commented 1 year ago

@Philonous I made the few last changes, rebased this, and merged it. Thank you for again your work on this! 😄