Custom SMS Gateway for Passwordless Connections not populating phone_number

Dear Team,
I have been trying use 2Factor.in as SMS gateway for using passwordless authentication
my gateway URL is as below where mykey is actual value.

“gateway_url”: “https://2factor.in/API/V1//SMS/ {{ phone_number }} /AUTOGEN/OTP1”,

but I am hoping when auth0 forwards the requests to 2factor it should populate the phone_number at the place of {{phone_number}}

But when I check the log from 2factor, it shows the request comes as the word {{ phone_number }}, I am unable to find any documentation.

If would be really nice if you can shed some light on this and help us in this regard.

Kind Regards
b2a

Hi @b2a.admn

Welcome back to the Auth0 Community!

Thank you for posting your question. Unfortunately, it’s not possible to connect to the 2factor.in SMS gateway in a plug-and-play fashion. The custom SMS gateway is strict, and to connect it to service like mentioned 2factor.in you would need to add an additional proxy layer that would transfer the request to the expected by the SMS gateway provider form. While setting up the middle layer make sure to follow our guide → Set Up Custom SMS Gateway for Passwordless Connections and adjust the proxy accordingly to the request from Auth0.

Thanks
Dawid

Thank you Dawid.
We have followed the guide however the request that is being sent to gateway is not injecting the phone_number I have given the details above, it sends the word phone_number as it is.
Can you please help/guide here as what needs to be done?

Kind Regards
B2A

Hi @b2a.admn

As I mentioned in the previous post, the Custom SMS gateway response is very strict, and the placeholder in the URL cannot be updated. If you want to use 2Factor.io, your best bet is to create a proxy layer that would take the auth0 request, adjust it, and pass it to 2Factor.io.

Thanks
Dawid

Dear Dawid,
We are ok with creating proxy layer, can you tell us how it should be and what it should do. Ay sample would be really appreciated.

like signature of URL and what should be the response of it
Kind Regards
B2A

Dear Dawid,
Thanks for the guidance, we created a proxy layer and now able to send the OTP using third party sms-gateway URL

Kind Regards
Bharat

1 Like

Thank you for the update, @b2a.admn; let me know if you have more questions!

Have a great day!
Dawid

Dear Dawid,
Now I am able to test the whole process using the below URL
https://dev-dhanman.us.auth0.com/passwordless/start

However, when we use this setting on our React native URL we get an error
“unauthorized_client: Client authentication is required,”

Can you please guide us as we are stuck here

Kind Regards
B2A

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.