Implement Auth.get_last_response_in_response_to()#283
Implement Auth.get_last_response_in_response_to()#283pitbulk merged 2 commits intoSAML-Toolkits:masterfrom
Conversation
Why not store the request_id in a session before the redirection to the IdP, storing such data in a cookie, so later you can read the cookie value (that belong this specific user) and be able to provide it to the process_response method?
If you store request IDs, you only know what IDs were generated, but not what ID belongs to what user. |
|
I know this is not a common case - but I believe adding this tool will be useful for implementations similar to this. |
In an SP initiated flow, last_response_in_response_to() will give flexibility to the developers when performing validation of the SAML Response.
Currently
process_response()takes in a single response id to compare with theInResponseTovalue of the response. However, the currentget_last_request_idfunction only returns the most recent ID, and this is not very helpful in these cases:get_last_request_idwhen processing the SAML Response, this will yield the ID of User B's SAML Request.InResponseToid by passing only one of them toprocess_response(). By storing a collection of request IDs, we can also associate other information with the ID to perform additional validation and processing on the SAML Response (e.g the IP address of the User who made the request, expected user name, platform information)Currently the
Responsemodel has aget_in_response_to()function, but this is not exposed to theAuthmodel. This PR allows developers to easily retrieve theInResponseTofrom the last processed SAML Response.