Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow phone numbers as login identifiers #137

Closed
aeneasr opened this issue Dec 9, 2019 · 24 comments
Closed

Allow phone numbers as login identifiers #137

aeneasr opened this issue Dec 9, 2019 · 24 comments
Milestone

Comments

@aeneasr
Copy link
Member

aeneasr commented Dec 9, 2019

Is your feature request related to a problem? Please describe.

We should allow users to use their phone number as the login identifier. This is very popular amongst mobile apps.

Describe the solution you'd like

We should support a format such as format: "phone_number" in the JSON Schema to allow the use of phone numbers.

One difficulty with phone numbers is uniqueness. For example, the following numbers are all pointing to the same SIM card (german phone number):

  • 0049123123123123
  • +49123123123123
  • +49 123 123 123 123
  • 0123 123 123 123
@aeneasr aeneasr added this to the v0.0.2 milestone Dec 9, 2019
@yindia
Copy link
Contributor

yindia commented Dec 12, 2019

@aeneasr can we divide the number into two parts i.e. country code + phone number by doing this we can maintain the uniqueness

@aeneasr
Copy link
Member Author

aeneasr commented Dec 13, 2019

That's a really good idea! I'm also pretty sure that there's a go library somewhere to help with this

@yindia
Copy link
Contributor

yindia commented Dec 13, 2019

@aeneasr you can check that project it's a implementation of google's libphonenumber

@aeneasr
Copy link
Member Author

aeneasr commented Dec 13, 2019

Ah nice! Of course Google solved that already :D I also found: https://github.com/nyaruka/phonenumbers

@yindia
Copy link
Contributor

yindia commented Dec 13, 2019

yes this project is forked from above project. Can i pick that one ?

@aeneasr
Copy link
Member Author

aeneasr commented Dec 13, 2019

Looks like https://github.com/nyaruka/phonenumbers is more active, and resolves issues

@aeneasr
Copy link
Member Author

aeneasr commented Dec 13, 2019

This issue is scheduled for the v0.0.2 milestone, it needs several other things to be implemented first, so it's not a good issue. I'll try to find another good issue for you now!

@aeneasr aeneasr modified the milestones: v0.4.0-alpha.1, unplanned Jun 8, 2020
@james-caresnap
Copy link

it needs several other things to be implemented first

Any chance this feature might get put back on the schedule?

@aeneasr
Copy link
Member Author

aeneasr commented Nov 9, 2020

We always welcome community contributions towards features such as these but we usually don't change priorities or give out timelines so I can't make any commitments here.

@robbietree8
Copy link

If I understand it correctly, what this issue wants to solve is as follows:

  1. Allow user register with their's phone number and verification code
  2. Allow user login with their's phone number and verification code

It's common that login with phone number and verification code, since there is no need for user to remember their password, but definitely, there is lots of things to consider, e.x.

  1. To support phone numbers from different countries
  2. Security concerns on verification code, abuse use maybe.

@slavafomin
Copy link

Please correct me if I'm wrong — so, it's not possible right now to verify user's phone number with Kratos (via SMS codes) or use it during the registration/login?

@aeneasr
Copy link
Member Author

aeneasr commented Feb 11, 2021

Yes, this is not possible at the moment! But it's on the roadmap!

@DavidBM
Copy link

DavidBM commented Feb 12, 2021

I'm reading the documentation. For the SMS verification can it be custom implemented by changing the state of the identity programmatically? I guess that can be stored in the traits, but I don't know if there is an internal state for identified to be verified or no (kind of what happens with the email verification flow). And, if there is, if it can be easily changed from the API.

@aeneasr
Copy link
Member Author

aeneasr commented Feb 15, 2021

Hm, not sure if I follow, could you expand your hypothesis a bit?

@DavidBM
Copy link

DavidBM commented Feb 17, 2021

Yeah, sorry for that.

I see in the documentation the concept of traits, which allows to store some state in an account. On there you can have things like the role of the user and other extra information.

I see that there is a flow that automatically sends an email in order to verify the email. Now, I'm assuming that the account is not "active" until the email is validated by the user. Or, if it is active, at least the email is not validated and that is stored somewhere. So the program communicating with Kratos knows that this account is not yet validated.

The main problem with the SMS is that that validation cannot be implemented in the same way the email is because Kratos doesn't yet implement that identification method. What I was thinking of is, is it possible to have the phone number and delegate the account "activation/verification" to an external service that later updates the account?

I'm assuming many things in here, as I didn't yet see in the docs how unverified accounts work in kratos. I hope I got it right and that it makes sense!

@aeneasr
Copy link
Member Author

aeneasr commented Feb 17, 2021

Hey yes that's absolutely possible to do externally for now. Keep in mind though that the identity traits can be modified by the user him/herself. We have plans for "protected" fields which can only be changed by admins/system processes/api calls. There's an issue for that, I just can't find it right now!

@albertoforcato
Copy link

Any update?

@tima-t
Copy link

tima-t commented Sep 20, 2021

Do we have any progress or intention to have mobile number registration/login in the near future.
I know that the team is overwhelmed, but just need some visibility as this is a hard requirement for the project I am working on.

@aeneasr
Copy link
Member Author

aeneasr commented Sep 20, 2021

Best option is to contribute this change. You can see what we are working on by taking a look at the milestones of this projects and its open PRs

oleksiireshetnik pushed a commit to oleksiireshetnik/kratos that referenced this issue Nov 8, 2021
@oleksiireshetnik
Copy link
Contributor

oleksiireshetnik commented Nov 8, 2021

Team of project that I'm working on finds Kratos a very good fit for our goals. We want to give it a try, but phone number support is critical feature for us.
For a moment I made a small proof of concept, in which added phone number identifier and extended courier with support of HTTP endpoint. This will allow integrate Kratos with Twillio or other SMS provider.
Will be happy to contribute this change

aeneasr pushed a commit that referenced this issue Dec 29, 2021
@vinckr
Copy link
Member

vinckr commented Jan 25, 2022

Hello @aeneasr , can this be closed as per #1938 phone numbers can now be used as identifiers?

Do we have/need docs for it?

@aeneasr
Copy link
Member Author

aeneasr commented Feb 24, 2022

Yes, I believe so

@aeneasr aeneasr closed this as completed Feb 24, 2022
@drigz
Copy link
Contributor

drigz commented Aug 11, 2022

FYI: docs still say:

This will be addressed in a future release and is tracked as kratos#137.

https://www.ory.sh/docs/kratos/concepts/credentials/username-email-password#use-case-username-and-password

@vinckr
Copy link
Member

vinckr commented Aug 11, 2022

Thanks for the headsup drigz 🙌 - will be removed in the next PR :)

peturgeorgievv pushed a commit to senteca/kratos-fork that referenced this issue Jun 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests