Send MFA and passwordless OTP messages via DataFlows SMS instead of Twilio. Perfect for Australian businesses looking for competitive SMS pricing.
- SMS Multi-Factor Authentication (MFA)
- Passwordless SMS login
- Customizable message templates
- Support for Australian and international numbers
- Log in to your DataFlows dashboard
- Navigate to Developer > Settings
- Copy your API Token
- Note your Sender ID (alphanumeric name or virtual number)
- Log in to your Auth0 Dashboard
- Go to Actions > Flows
- Click Send Phone Message
- Click + (Add Action) > Build Custom
- Name it:
DataFlows SMS Provider - Set Trigger:
Send Phone Message - Set Runtime:
Node 18 - Click Create
Copy the contents of dataflows-sms-action.js into the Auth0 Action editor.
In the Auth0 Action editor, click Secrets (key icon) and add:
| Secret Name | Value |
|---|---|
DATAFLOWS_API_KEY |
Your DataFlows API token |
DATAFLOWS_SENDER_ID |
Your Sender ID (e.g., DataFlows or 61412345678) |
MESSAGE_TEMPLATE |
(Optional) Custom message, e.g., Your MyApp code is: {{code}} |
- Click Deploy in the Action editor
- Go back to Actions > Flows > Send Phone Message
- Drag your
DataFlows SMS Provideraction into the flow - Click Apply
- Go to Security > Multi-factor Auth
- Click Phone Message
- Enable it and select Custom as the delivery provider
- Choose SMS as the delivery method
- Save your changes
- Go to User Management > Users
- Select a test user
- Click Send Verification SMS (if available)
import { WebAuth } from 'auth0-js';
const auth0 = new WebAuth({
domain: 'YOUR_DOMAIN.auth0.com',
clientID: 'YOUR_CLIENT_ID'
});
// Start passwordless login
auth0.passwordlessStart({
connection: 'sms',
send: 'code',
phoneNumber: '+61412345678'
}, (err, res) => {
if (err) console.error(err);
console.log('OTP sent!');
});Use {{code}} as the placeholder for the verification code:
Your MyApp verification code is: {{code}}
{{code}} is your login code. It expires in 5 minutes.
- Check Auth0 Logs: Monitoring > Logs
- Look for
SendPhoneMessageevents - Verify your DataFlows API key is correct
- Ensure phone number includes country code (e.g.,
+61412345678) - Check your DataFlows SMS credit balance
- In the Action editor, check the Test tab
- Run a test with sample data:
{
"message_options": {
"recipient": "+61412345678",
"text": "123456"
},
"secrets": {
"DATAFLOWS_API_KEY": "your_api_key",
"DATAFLOWS_SENDER_ID": "DataFlows"
}
}- DataFlows: support@dataflows.com.au
- Website: https://dataflows.com.au
- API Docs: https://sms.dataflows.com.au/developers/http-docs
MIT License - Feel free to use and modify for your projects.