allow registering passkeys without passwords #1834

Open
opened 2026-03-13 09:06:50 -05:00 by GiteaMirror · 8 comments
Owner

Originally created by @proof-llc on GitHub (Sep 3, 2025).

Is this suited for github?

  • Yes, this is suited for github

No response

Describe the solution you'd like

At present, it appears email/password is first class citizen. i want to be able to register with passkey and email and don't want a password at all. at present, i first have to force the client to create a password before i can register his passkey.

Describe alternatives you've considered

i can generate a random password for user (and avoid asking him) but that is hacky.

Additional context

No response

Originally created by @proof-llc on GitHub (Sep 3, 2025). ### Is this suited for github? - [ ] Yes, this is suited for github ### Is your feature request related to a problem? Please describe. _No response_ ### Describe the solution you'd like At present, it appears email/password is first class citizen. i want to be able to register with passkey and email and don't want a password at all. at present, i first have to force the client to create a password before i can register his passkey. ### Describe alternatives you've considered i can generate a random password for user (and avoid asking him) but that is hacky. ### Additional context _No response_
GiteaMirror added the enhancement label 2026-03-13 09:06:50 -05:00
Author
Owner

@himself65 commented on GitHub (Sep 4, 2025):

I had a similar feature request; basically, they want to set something as a main login method rather than a password.

I think we should have a login method globally. Maybe I didn't put time into this yet. Feel free to give any comment

@himself65 commented on GitHub (Sep 4, 2025): I had a similar feature request; basically, they want to set something as a main login method rather than a password. I think we should have a login method globally. Maybe I didn't put time into this yet. Feel free to give any comment
Author
Owner

@nadilas commented on GitHub (Sep 16, 2025):

This would be a great convenience feature

@nadilas commented on GitHub (Sep 16, 2025): This would be a great convenience feature
Author
Owner

@mburumaxwell commented on GitHub (Nov 3, 2025):

This is possible when using magic link so that the email is verified automatically. Adding a passkey can be done after that.
Example: https://better-auth-ui.com sample at https://newtech.dev/auth/magic-link (I am not affiliated to either).

@mburumaxwell commented on GitHub (Nov 3, 2025): This is possible when using magic link so that the email is verified automatically. Adding a passkey can be done after that. Example: https://better-auth-ui.com sample at https://newtech.dev/auth/magic-link (I am not affiliated to either).
Author
Owner

@better-auth-agent[bot] commented on GitHub (Nov 3, 2025):

Based on your description, the recommended troubleshooting approach is to use a magic link–driven flow to register and verify the user’s email without initially requiring a password, and then to add the passkey afterward. This means you would:

  1. Configure the magic link (or email OTP) plugin so that when a new user clicks the link (or enters the OTP) their email is verified automatically and a new account is created without needing a password.

  2. Once the account is active, enroll the user’s passkey via the passkey registration endpoint. This avoids the hacky workaround of generating a random password.

This approach aligns with previously suggested solutions where the primary authentication method is shifted from email/password to a passwordless flow using a magic link, and then the passkey can be added post-registration [1], [3].

Next steps:
• Verify that your magic link configuration is set to auto-verify emails on signup.
• Ensure your passkey registration endpoint is called after successful magic link verification.
• Test the full flow to guarantee that no password is required at any point during registration.

If issues persist, double-check your plugin configuration and consult any available debugging logs to ensure that email verification and passkey registration are triggered in the correct sequence.

DiagramDiscordGitHub

Diagram Join Star

@better-auth-agent[bot] commented on GitHub (Nov 3, 2025): Based on your description, the recommended troubleshooting approach is to use a magic link–driven flow to register and verify the user’s email without initially requiring a password, and then to add the passkey afterward. This means you would: 1. Configure the magic link (or email OTP) plugin so that when a new user clicks the link (or enters the OTP) their email is verified automatically and a new account is created without needing a password. 2. Once the account is active, enroll the user’s passkey via the passkey registration endpoint. This avoids the hacky workaround of generating a random password. This approach aligns with previously suggested solutions where the primary authentication method is shifted from email/password to a passwordless flow using a magic link, and then the passkey can be added post-registration [[1]](https://github.com/better-auth/better-auth/issues/4396), [[3]](https://github.com/better-auth/better-auth/issues/1433). Next steps: • Verify that your magic link configuration is set to auto-verify emails on signup. • Ensure your passkey registration endpoint is called after successful magic link verification. • Test the full flow to guarantee that no password is required at any point during registration. If issues persist, double-check your plugin configuration and consult any available debugging logs to ensure that email verification and passkey registration are triggered in the correct sequence. <!-- bot:webhook reply v1 --> [Diagram](https://repodiagrams.s3.eu-north-1.amazonaws.com/better-auth_ultra_detailed_interactive.html) • [Discord](https://discord.gg/better-auth) • [GitHub](https://github.com/better-auth/better-auth) [![Diagram](https://img.shields.io/badge/Diagram-2b3137?style=flat-square)](https://repodiagrams.s3.eu-north-1.amazonaws.com/better-auth_ultra_detailed_interactive.html) [![Join](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&style=flat-square)](https://discord.gg/better-auth) [![Star](https://img.shields.io/badge/star-181717?logo=github&logoColor=white&style=flat-square)](https://github.com/better-auth/better-auth)
Author
Owner

@slavarazum commented on GitHub (Nov 19, 2025):

It would be great to be able to create an account using only a passkey, with or without providing an email beforehand.

@slavarazum commented on GitHub (Nov 19, 2025): It would be great to be able to create an account using only a passkey, with or without providing an email beforehand.
Author
Owner

@slavarazum commented on GitHub (Nov 27, 2025):

Current work around using anonymous signIn.

The passkey plugin currently uses the same name for both the database record and the passkey stored on the user’s authenticator. These names must differ.

The database should store a name that appears in the user’s account and helps identify which authenticator created the passkey, such as 1Password, Mac internal, or YubiKey.

The authenticator, however, should store the “username,” which is a human‑friendly identifier for the user’s account. It can be a unique username, an email address, or a phone number.

https://developer.mozilla.org/en-US/docs/Web/API/PublicKeyCredentialCreationOptions#user

and we currently don't have the ability to set displayName.

I feel that the main issue with such passkey implementation is a basic misunderstanding of what passkeys actually are.
It seems people interpret it as a second factor, like some kind of an addition to traditional methods, but it isn’t.

Passkeys – are replacement for traditional methods, it should be possible to use it as a primary method.

https://passkeys.dev

Workaround

const username = getUserNameFromTheUserInput()

await authClient.signIn.anonymous()

const passkey = await authClient.passkey.addPasskey({
  name: username,
})


// after a user completes the passkey creation process, let’s rename it to match the corresponding authenticator name
await authClient.passkey.updatePasskey({
  id: passkey.id,
  name: detectDeviceName(), // get the device name: Mac, iPhone, Windows PC... or you can collect this name from the user's input as well
})

// if everything is ok, lets remove the anonymous status from the user's account
await authClient.updateUser({
  isAnonymous: false,
} as Parameters<typeof authClient.updateUser>[0] & { isAnonymous: boolean })

@slavarazum commented on GitHub (Nov 27, 2025): Current work around using _anonymous_ signIn. The passkey plugin currently uses the same name for both the database record and the passkey stored on the user’s authenticator. These names must differ. The database should store a name that appears in the user’s account and helps identify which authenticator created the passkey, such as 1Password, Mac internal, or YubiKey. The authenticator, however, should store the “username,” which is a human‑friendly identifier for the user’s account. It can be a unique username, an email address, or a phone number. https://developer.mozilla.org/en-US/docs/Web/API/PublicKeyCredentialCreationOptions#user and we currently don't have the ability to set displayName. I feel that the main issue with such passkey implementation is a basic misunderstanding of what passkeys actually are. It seems people interpret it as a second factor, like some kind of an addition to traditional methods, but it isn’t. Passkeys – are **replacement** for traditional methods, it should be possible to use it as a primary method. https://passkeys.dev ## Workaround ```ts const username = getUserNameFromTheUserInput() await authClient.signIn.anonymous() const passkey = await authClient.passkey.addPasskey({ name: username, }) // after a user completes the passkey creation process, let’s rename it to match the corresponding authenticator name await authClient.passkey.updatePasskey({ id: passkey.id, name: detectDeviceName(), // get the device name: Mac, iPhone, Windows PC... or you can collect this name from the user's input as well }) // if everything is ok, lets remove the anonymous status from the user's account await authClient.updateUser({ isAnonymous: false, } as Parameters<typeof authClient.updateUser>[0] & { isAnonymous: boolean }) ```
Author
Owner

@dosubot[bot] commented on GitHub (Feb 26, 2026):

Hi, @proof-llc. I'm Dosu, and I'm helping the better-auth team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You requested the ability to register accounts using passkeys and email without requiring a password, aiming for a simpler approach than generating random passwords.
  • Contributors highlighted that passkeys should be a primary login method rather than just a second factor.
  • Suggestions included differentiating passkey display names and supporting anonymous sign-in flows.
  • A recommended approach was to use a magic link flow to verify email first, then add the passkey, avoiding hacky workarounds.
  • The core need remains for native passwordless registration flows with passkeys as the main authentication method.

Next Steps:

  • Please let me know if this issue is still relevant to the latest version of better-auth by commenting here.
  • If I don’t hear back within 7 days, I will automatically close this issue.

Thanks for your understanding and contribution!

@dosubot[bot] commented on GitHub (Feb 26, 2026): Hi, @proof-llc. I'm [Dosu](https://dosu.dev), and I'm helping the better-auth team manage their backlog and am marking this issue as stale. **Issue Summary:** - You requested the ability to register accounts using passkeys and email without requiring a password, aiming for a simpler approach than generating random passwords. - Contributors highlighted that passkeys should be a primary login method rather than just a second factor. - Suggestions included differentiating passkey display names and supporting anonymous sign-in flows. - A recommended approach was to use a magic link flow to verify email first, then add the passkey, avoiding hacky workarounds. - The core need remains for native passwordless registration flows with passkeys as the main authentication method. **Next Steps:** - Please let me know if this issue is still relevant to the latest version of better-auth by commenting here. - If I don’t hear back within 7 days, I will automatically close this issue. Thanks for your understanding and contribution!
Author
Owner

@proof-llc commented on GitHub (Feb 27, 2026):

yes, still relevant

@proof-llc commented on GitHub (Feb 27, 2026): yes, still relevant
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#1834