Forum Discussion
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
- JVK_45053
Altostratus
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
- JVK_45053
Altostratus
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.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com