whisperfish / presage

A high-level Rust library to help write clients for the Signal Messenger.
GNU Affero General Public License v3.0
98 stars 15 forks source link

Sending a OTP text message to a 'new' contact? #248

Open virtualritz opened 3 months ago

virtualritz commented 3 months ago

I'm looking into adding Signal support for an app that uses one-time-passwords (OTPs) sent to user's phone numbers to verify them. I.e. the app is sending OTPs via SMS, WhatsApp message, phone call (with voice) etc.

For Signal support I would need to be able to send a text message with the OTP to a phone number that is not in my contacts.

Is this possible at all with the Signal API in general or the API exposed in this crate?

It seems the Signal clients themselves handle contact discovery behind the scenes, through the phone's contact list. I.e. there is no way to add a phone number to Signal inside the app itself. So I wonder if this is intentionally done this way by Signal (spam prevention) and what I want to do is not possible at all?

As a workaround: is it possible to send a request to a user to allow messages from that number? It would mean sending an OTP is a two-step process but it would be better than not being able to offer this at all.

gferon commented 3 months ago

This has been a missing feature of our stack for quite some time. I'm currently working on integrating the PNI system which should be the first step necessary to make this possible. I'll keep track of this issue and see what else needs to be done afterwards.