Forum Discussion

JVK_45053's avatar
JVK_45053
Icon for Altostratus rankAltostratus
Feb 01, 2015

Custom Variable from HTTP response header

I am currently testing OTP with HTTP authentication. We had created a web server which has a form in which we post the username and password and if successfully authenticated will return a response header with content SUCCESS:XXXXXXX where X is the mobile number for that user.

 

Currently i am able to authenticate and get the return string but i need some help in taking the mobile number and mapping to a custom variable so that this can be used to send the OTP.

 

2 Replies

  • Created a custom variable mapping

     

    session.custom.mobile = regexp {SUCCESS: (\d*)} [mcget {session.http.last.response_header.0}] \1 mobile; return $mobile

     

    This worked.

     

    The solution was designed to authenticate non AD users (like stored in SQL database) with OTP.

     

  • The response header looks like this.

     

    HTTP/1.1 200 OK Cache-Control: private Content-Type: text/html; charset=utf-8 Server: SUCCESS: 1234567 Date: Content-Length: 493