Forum Discussion

Al_7443's avatar
Al_7443
Icon for Nimbostratus rankNimbostratus
Jul 05, 2018

Retrieve Cookie from Post Response

Hi All,

 

I'm trying to 'shim' an authentication request to an app, and do a bit of MFA magic with it before returning the cookie to the client. Essentially we grab the User and Pass from the initial post request, and forward the user to our MFA service. I'd like to be able to grab the 'set-cookie' header from the post response from the back-end server (and store it encrypted in a table until the user completes their MFA).

 

MFA part works great, and I can send back a hard-coded cookie to the client, just stuck on how to grab the response from the server, any help would be great, please.

 

1 Reply

  • The HTTP::cookie command can be used in the HTTP request and response event. In HTTP_RESPONSE it is reading the Set-Cookie header so if you know the cookie name can just use HTTP::cookie value, for example:

    when HTTP_RESPONSE {
       set cookieValue [HTTP::cookie value MFACookie]
        TODO: Encrypt $cookieValue and save to table
    }