Hello,
I did not find time for learning to code a custom MFA, but i did do a poc about integration with whasapp for otp sending, hope it helps you.
1. On your member profile page, add a checkbox (or something) to get the permission from user to send via whatsapp(because whatsapp requires you to do this)
2. Configure and use the default authentication handler or write a custom one, but remember to get the user's choice in your credential attributes list
4. Get yourself a facebook business acount, create an app(
https://developers.facebook.com/apps) and add whatsapp usage, you can use demo account and add 5 phone numbers(you need to add it first) to send/test, and remember to generate an api key/client
5. use that api to send your otp to your user(for demo accounts, you need to register your number): example otp request
{
"messaging_product": "whatsapp",
"to": "<USER_PHONE>",
"type": "template",
"template": {
"name": "<TEMPLATE-NAME>", // use a template from the Authentication category, remember the placeholder names
"language": {
"code": "tr" // be careful and check language options of your selected templates
},
"components": [
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "01234565" // message body OTP value placeholder value
}
]
},
{
"type": "button", // i chose "copy button" instead of "zero tap" on template setting so i add this for the copy button to work
"sub_type": "url",
"index": "0",
"parameters": [
{
"type": "text",
"text": "01234565" // Copy Value button's placeholder value
}
]
}
]
}
}
6. this api just returns 200 for request, so configure and use the webhooks to store and verify the wp otp message statuses (sent, read etc... updates for your OTP code message)
capabilities...
4 Ekim 2024 Cuma tarihinde saat 06:33:11 UTC+3 itibarıyla Irfan Kamil şunları yazdı: