goauthentik / authentik

The authentication glue you need.
https://goauthentik.io
Other
7.89k stars 609 forks source link

FR: Support validation policies on SMS setup stages #4049

Open samip5 opened 1 year ago

samip5 commented 1 year ago

Is your feature request related to a problem? Please describe. I would like to restrict the country code phone numbers are accepted from with a validation policy so that people cannot verify out-of-country phone numbers.

Describe the solution you'd like Ability to use policies with SMS stages.

Additional context Currently it's a little troublesome that one cannot simply attach an validator to the stage that asks for the phone number, but rather it would accept any phone number, which is not always wanted.

BeryJu commented 2 months ago

This can be worked around by using a prompt stage to ask for the phone number and setting the field key to phone, where you can do the validation, and then the SMS setup stage won't prompt for a phone number

samip5 commented 2 months ago

The whole SMS thing is currently troublesome as well due to no ability to retry the sending of SMS like is usually possible (#8001).

DuvelCorp commented 2 months ago

I am also struggling with this. And I am really surprised that mobile phone numbers user fields isnt handled natively and build into the core of Authentik as it is something as important as an email address for many systems and an absolute necessity in case of SMS OTP. And it is thus obvious that phone numbers validation at enrollment or on user settings change should be a thing.

Ie, there should bea combobox to select the country code and then a validation of the rest using for instance https://github.com/google/libphonenumber

As long as this is not implemented into Authentik,, any SMS OTP system can reliably NOT work because most of your users will enter their phone numbers in incorrect format, that is a fact in all IT systems for 50 years :-)