authgear / authgear-server

Open source alternative to Auth0 / Firebase Auth
https://www.authgear.com
Apache License 2.0
73 stars 30 forks source link

WhatsApp as alternative to SMS for sending OTP in Verification #3027

Closed fungc-io closed 1 year ago

fungc-io commented 1 year ago

Problem

Solution

Appetite

2 weeks

tung2744 commented 1 year ago

Wati

Pricing

https://support.wati.io/l/en/article/1w0qfawav7-conversation-based-pricing-our-new-pri

0.051 USD / conversation in hong kong (Authentication template) 0.0566 USD / conversation in hong kong (Utility template)

Message Template

Authentication

Screenshot 2023-05-17 at 8 55 54 PM

Utility

I tried to create a template with the following content.

{{AppName}}
Your one-time password is {{Code}}

But it will reject my template. I can request a review but I am not sure if it would pass the review because utility templates are not for authentication.

Whatsapp (Cloud-api)

Pricing

https://scontent-hkg4-1.xx.fbcdn.net/v/t39.8562-6/343340495_556945759927254_5506526186653119432_n.csv?_nc_cat=103&ccb=1-7&_nc_sid=ae5e01&_nc_ohc=MP6l2nI4YQgAX_62glj&_nc_ht=scontent-hkg4-1.xx&oh=00_AfAWGChNZ0dMt4M4LnpwsfobP4QBVekdOUsanhaBW98vRw&oe=64695250

Problem

tung2744 commented 1 year ago

@fungc-io It seems the restriction of authenticate template make it unusable in authgear, because we cannot display the app name in the message. And also it seems not possible to use other templates for authenticate purpose.

fungc-io commented 1 year ago

@tung2744 Can we customize the message to display the app name if we use the Official API and use our own phone number?

tung2744 commented 1 year ago

@fungc-io The templates are defined by facebook. For authentication, there is only one non-customizable template.

However, yesterday I finally made a template with utility type which can be submitted for review. https://business.facebook.com/wa/manage/message-templates/?business_id=10153179122721485&waba_id=107153018658275

And it was just approved.

tung2744 commented 1 year ago

Asked here https://business.facebook.com/direct-support/question/571803688274436/?force_full_site=0&business_id=10153179122721485

tung2744 commented 1 year ago

@louischan-oursky @fungc-io Do you think we should have separated rate limit configs for whatsapp?

fungc-io commented 1 year ago

I think so as we have granular controls for other channels too

tung2744 commented 1 year ago

@fungc-io Facebook said they increased the number limit of the Whatsapp business account and I've successfully added the number. However a new whatsapp account was created, could you help setup payment there?

fungc-io commented 1 year ago

@tung2744 , added, please try again

fungc-io commented 1 year ago

Ready on staging, pending deployment Follow up in #3137