SMS Configuration and Phone Validation in Tinode

65 views
Skip to first unread message

Marcio Mauricio

unread,
Oct 11, 2024, 7:49:04 AM10/11/24
to Tinode General

I am trying to configure SMS messaging as an alternative and found the "tel" object in the tinode.conf file, which contains the message settings. However, I couldn't find where to specify the API keys for twilio.com...

I also noticed that the webapp code includes the phone field.
I found a message here in the forum saying that the phone validator was not completed. Has the validator been finished?
Do the mobile apps already support phone number validation?

Att. 

Gene

unread,
Oct 11, 2024, 2:15:19 PM10/11/24
to Tinode General
We don't have support for SMS validation in the server because there is no single standard for sending SMS. Basically, the code https://github.com/tinode/chat/blob/master/server/validate/tel/validate.go#L257 does nothing. We can add it. It's not a lot of work. Do you need it?

Yes, the mobile apps support SMS validation but it has not been well tested.

Marcio Mauricio

unread,
Oct 11, 2024, 3:09:10 PM10/11/24
to Tinode General

Yes, I will need to validate mobile phone numbers. If you could include it or send me the necessary code, it would be really helpful.

Also, I wanted to ask if there's any specific configuration that needs to be done in the config.js of the webapp to request the phone number field and in the config.conf of the server to enable the use of mobile phone?

Thanks in advance!

Gene

unread,
Oct 12, 2024, 2:11:35 AM10/12/24
to Tinode General
We need to write the code before we can send it to you. Would you mind providing us with Twilio credentials for testing the service? We would also ask you to help with testing it. 

Marcio Mauricio

unread,
Oct 12, 2024, 8:29:34 AM10/12/24
to Tinode General

I’ve sent the credentials to your email to avoid sharing them publicly.

Thank you.

Gene

unread,
Oct 12, 2024, 11:27:58 AM10/12/24
to Tinode General
Thank you. Will look into it.

Gene

unread,
Oct 15, 2024, 4:58:07 AM10/15/24
to Tinode General

Marcio Mauricio

unread,
Oct 15, 2024, 10:27:16 AM10/15/24
to Tinode General

Ok, I’ll take a look.
I’d also like to take this opportunity to clarify a few things.
I noticed that in the web app, there’s a variable (this.props.reqCredMethod) that defines whether the default authentication method is by email or phone to display the field, but I couldn’t find where to change this setting in the configuration. Could you tell me where I can configure that?

Also, is there a setting that allows me to use both methods (email and phone) for authentication?

Gene

unread,
Oct 15, 2024, 11:09:01 AM10/15/24
to Tinode General
On Tuesday, October 15, 2024 at 5:27:16 PM UTC+3 Marcio Mauricio wrote:

Ok, I’ll take a look.
I’d also like to take this opportunity to clarify a few things.
I noticed that in the web app, there’s a variable (this.props.reqCredMethod) that defines whether the default authentication method is by email or phone to display the field, but I couldn’t find where to change this setting in the configuration. Could you tell me where I can configure that?


Also, is there a setting that allows me to use both methods (email and phone) for authentication?

Both or either? Or how?

Marcio Mauricio

unread,
Oct 15, 2024, 12:35:34 PM10/15/24
to Tinode General
Captura de tela de 2024-10-15 13-28-47.png
In the webapp, as the code shows, the variable this.props.reqCredMethod can be either "email" or "tel", which suggests that the application is designed to validate one method (email or phone) but not both at the same time. My question is, will any adjustments be needed to validate both email and phone simultaneously?

Gene

unread,
Oct 15, 2024, 12:40:25 PM10/15/24
to Tinode General
On Tuesday, October 15, 2024 at 7:35:34 PM UTC+3 Marcio Mauricio wrote:
Captura de tela de 2024-10-15 13-28-47.png
In the webapp, as the code shows, the variable this.props.reqCredMethod can be either "email" or "tel", which suggests that the application is designed to validate one method (email or phone) but not both at the same time. My question is, will any adjustments be needed to validate both email and phone simultaneously?

What is exactly the algorithm of validating by both?

1. Send different codes through email and SMS, validate only if both are correctly entered.
2. Send different codes through email and SMS, validate if either is correctly entered.
3. Send the same code through email and SMS, validate if it's correctly entered.
4. Offer to send the code through either email or SMS, validate if it's correctly entered.
5. Something else?

Marcio Mauricio

unread,
Oct 15, 2024, 1:15:51 PM10/15/24
to Tinode General
That's all for now.
Thank you very much.

Marcio Mauricio

unread,
Oct 20, 2024, 1:54:24 PM10/20/24
to Tinode General
I was building the version now and noticed that the twilioInit and twilioSend methods were not present. Could it be that something was left out of the commit?

$ go build -o server
# github.com/tinode/chat/server/validate/tel
validate/tel/validate.go:99:12: undefined: twilioInit
validate/tel/validate.go:267:13: undefined: twilioSend

Gene

unread,
Oct 20, 2024, 2:09:12 PM10/20/24
to Tinode General
Yes, indeed, I forgot to check in a file. Fixed. Thank you.

Marcio Mauricio

unread,
Oct 20, 2024, 2:57:34 PM10/20/24
to Tinode General
Thank you for the quick fix, Gene! I appreciate it. Now, I’m working on resolving the PostgreSQL adapter issue.
Reply all
Reply to author
Forward
0 new messages