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

How to add support for multiple devices on an account? #87

Open
Whip opened this issue Feb 5, 2024 · 5 comments
Open

How to add support for multiple devices on an account? #87

Whip opened this issue Feb 5, 2024 · 5 comments
Labels
question Further information is requested

Comments

@Whip
Copy link

Whip commented Feb 5, 2024

Thanks for the library. So far I've managed to make it work well but on a single device only. A user can certainly use multiple devices to login to their account and I want to have a system where the site registers the new device and links it to the customer. Here's how it works:

  • Step 1: New user signup on Android phone. New registration is created and after verification credentialId and public key is saved to the database.
    User 1: Name, email, phone, etc
    User device 1: User id, credentialId, public_key
  • Step 2: Login on the same device. User provides their email. We fetch the credentialIds from the database, pass it to getGetArgs. Android prompts user to scan fingerprint, the user is authenticated.
  • Step 3: Login from a windows computer. User enters their email and we fetch credentialIds, so far there's just one that belongs to their android phone. The response from getGetArgs is passed to navigator.credentials.get. Windows does not prompt user to scan fingerprint.

I believe there should be an option to check whether any of those credentialIds are on the device and return an exception if none is found. Then we can handle that by registering the new device. How would you handle this situation?

@lbuchs
Copy link
Owner

lbuchs commented Feb 6, 2024

when using passkeys, the windows computer provides a qr code which can be scanned with the android device. Then the private key gets transmitted to the windows computer and the user can login from there too.

If you're not using passkeys, it would be a security risk to ask for adding a new device when there is no key saved on a device - If this would work, when I've got the username & password of a user I can easily login with it and add my computer to the account. If you want to support this case, you have to provide a alternative 2FA method (Email, SMS, ...) to ensure that the new computer is a device of the user.

@lbuchs lbuchs added the question Further information is requested label Feb 6, 2024
@timcappalli
Copy link

when using passkeys, the windows computer provides a qr code which can be scanned with the android device

The private key does not leave the authenticator. An assertion is passed from the authenticator to the client.

@Whip
Copy link
Author

Whip commented Feb 7, 2024 via email

@seanh0895
Copy link

when using passkeys, the windows computer provides a qr code which can be scanned with the android device

The private key does not leave the authenticator. An assertion is passed from the authenticator to the client.

Is it still CTAP2 with Passkeys?

@lbuchs
Copy link
Owner

lbuchs commented Feb 15, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants