Parses the specified message.
def check_response(response: str) -> None: ...
on_check_response parses a variety of messages that are sent to the Server as part of the authentication process.
The following messages can be parsed using this method:
- The threeDSMethodData form variables received at the method_notification_url
- The Results Request message received at the results_url
- The cres form variables received at the notification_url
When calling the method, pass the message to be parsed as the Response parameter. The properties which are populated after calling this method vary depending on the type of message being parsed. See below for additional information.
Method Data from method_notification_url
After calling get_method_data, a request is made to the card_range_method_url. After this, the ACS will make a POST to method_notification_url to inform the requestor of completion. Retrieve the threeDSMethodData form variable value that was POSTed and pass it to this method. After calling this method, the following properties are populated:server_transaction_id may be used to match the response with the request.
Results Request message from results_url
When a challenge is completed for both app-based and browser-based flows, a POST is made to the results_url with a Results Request message.
Prior to checking this RReq message, the ServerTransactionId can be extracted using the ExtractRReqServerTransactionId configuration setting. This value can then be used to look up details on the transaction that were saved prior to starting the challenge process, including the messageVersion which must be set via the ProtocolVersion configuration setting prior to passing the RReq message to the on_check_response method.
After calling this method, the following properties are populated:
To respond to the POST, set results_status to the appropriate value and call get_results_response to build a response message to be sent back to the directory server. Use the value from get_results_response in your application as the body of the HTTP response. Set the Content-Type header to application/JSON; charset=utf-8
Final Challenge Response from notification_url
In a browser-based flow, the challenge takes place directly between the cardholder and the ACS in a separate iframe or window. The ACS will POST the final challenge response to the notification_url after the challenge is complete. Retrieve the cres form variable value from the POST data and pass it to on_check_response. After calling this method the following properties are populated:
In addition to the cres variable, a threeDSSessionData variable will be present if SessionData was set before calling get_challenge_request. The threeDSSessionData value POSTed to notification_url may be passed to EncodedSessionData. Query SessionData to get the decoded session data.