10-Jul-2019 07:53
Hello,
I'd like to do OTP SMS via an HTTP API
I'm reading this link but is it still up to date (February,2011) ? the VPE is still OK or maybe they are news things..
Should I still need the iRule (It doesn't seem to be working (BIG IP v12.1.3.7)) ? Or can I use the OTP GENERATE object rather ?
Second thing I don't understand the use of "Variable Asssign HTTP", same for the username variable
Thanks
Solved! Go to Solution.
15-Jul-2019 00:22
Hi cd,
I'm using a hardware device SMSEagle as my SMS gateway with APM.
As Neils rightly said above, there is no need to use an iRule.
I'm using these VPE agents in this particular sequence:
OTP Generate
HTTP Auth (to send the OTP as SMS)
Logon Page (to collect the OTP)
OTP Verify
Please refer to attached screenshots.
I hope it helps.
14-Jul-2019 03:55
It seems the documentation you are referring to is a little outdated. You don't need to use the iRule to create an OTP. Just use the 'OTP Generate' agent in the VPE.
The 'Variable Assign HTTP' is being used to match the AAA HTTP sms_auth object. You can see the fields 'Form Parameter for User Name' being set to 'to' and the 'Form Parameter for Password' being set to 'text'. These fields are being read from 'session.logon.last.username' and 'session.logon.last.password'.
Which SMS gateway are you using? If using MessageBird you could also use this code:
Note that there are also other code snippets available for other SMS gateway providers.
15-Jul-2019 00:22
Hi cd,
I'm using a hardware device SMSEagle as my SMS gateway with APM.
As Neils rightly said above, there is no need to use an iRule.
I'm using these VPE agents in this particular sequence:
OTP Generate
HTTP Auth (to send the OTP as SMS)
Logon Page (to collect the OTP)
OTP Verify
Please refer to attached screenshots.
I hope it helps.
16-Jul-2019 03:29
Thanks for your help !!
If you can help me to configure my HTTP API Server
Here the information of the API:
Endpoint
Ressource
/restapi/v1/sms/send
Paramètres
?destinationAddress=33xxxxxxxxx&messageText=xxxxxxxxxxx&username=loginxxx&password=pwdxxx
TEST:
https://europe.ipx.com/restapi/v1/sms/send?destinationAddress=33xxxxxxxxx&messageText=Test&username= xxxxxxxxx &password=xxxxxxx
16-Jul-2019 04:43
Hi,
You are missing the "?" at the end of Form Action URL:
It should be: https://europe.ipx.com/restapi/v1/sms/send?
16-Jul-2019 07:01
Even with the "?" it still dosent work:
> Session variable 'session.http.last.errmsg' set to 'Curl perform failed: Couldn't connect to server'
I tried with GET or POST METHOD
Using Postman the curl is working in POST METHOD
>POSThttps://europe.ipx.com/restapi/v1/sms/send
BODY >messageText=test+Message+1&destinationAddress=33611223344&username=xxxxxxxt&password=xxxxx
WITH HEADER> Accept:application/json and Content-Type:application/x-www-form-urlencoded
From F5 it doesn't work
curl -vkX POST https://europe.ipx.com/restapi/v1/sms/send -d 'messageText=REST+test4&destinationAddress=33611223344&username=xxxxxx&password=xxxxxxx'
* About to connect() to europe.ipx.com port 443 (#0)
* Trying 194.165.14.200... Connection refused
* couldn't connect to host
* Closing connection #0
curl: (7) couldn't connect to host
I tried the curl command from an other linux server and it's working but not from the F5 😕
17-Jul-2019 00:34
It looks like your F5 might be blocked by a firewall or router when trying to reach the SMS GW? Also check from which interface the calls are being sourced when APM initiates the connection.
BR, Marcus
18-Jul-2019 04:16
Yeah it's worked finally but I needed to use a custom post in AAA HTTP Server and use un custom body. Also add custom headers with "Accept:application/json and Content-Type:application/x-www-form-urlencoded"
01-Jun-2022 04:17
Dear CD,
thanks for sharing your knowledge. Have you any step-by-step documents for this solution? Let me explain a little my scenario first.
I do have a BIG-IP VE ver 16+ WAF, I want to publish a virtual server, where OTP SMS will be generated by my own SMS Windows gateway. Please share any doc for this MFA Deployment with AD Authentication.
18-Dec-2020 02:33
Hi CD, I also have to use a custom post and have some trouble getting it to work. Were you able to use variables in your custom post?
22-Dec-2022 03:40
One-time password (OTP) SMS is a method of authenticating a user by sending a unique code to their phone via SMS, which the user can then enter to confirm their identity. This can be useful for adding an extra layer of security to online accounts or transactions.
To send OTP SMS messages using an API (Application Programming Interface), you will need to use an SMS gateway service that provides an API for sending SMS messages. There are many SMS gateway providers that offer API access, and the specific details of how to use the API will depend on the provider you choose.
Generally, you will need to sign up for an account with an SMS gateway provider and obtain API credentials (such as an API key or token) that you can use to authenticate your API requests. You will then be able to use the API to send SMS messages to phone numbers that you specify, including OTP messages.
For example, you might use the API to send an OTP message to a user's phone number when they request to reset their password on your website. The user would then enter the OTP code they receive via SMS to confirm their identity and complete the password reset process.
It's important to note that you will need to ensure that you are compliant with any relevant laws and regulations regarding the use of SMS messages, including obtaining the necessary consent from users before sending them SMS messages.
Source: SMSala