-
-
Notifications
You must be signed in to change notification settings - Fork 554
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
[5.x] Add passkey 🔑 support to CP logins #9239
base: 5.x
Are you sure you want to change the base?
Conversation
One note regarding this that I don't remember being in this PR. I feel Statamic should disable the option to login with password for the account that has a Passkey set. That seems to be the standard, as otherwise there's no security benefit, but it's just a convenience. |
Looking at GitHub as an example, I have set up a passkey there, but they still give me the option to sign in with a username and password. Both work. |
I see, you’re right regarding GitHub. I’m honestly surprised by that. That is not what I see most sites that offer Passkeys do. For example my accounting software completely disables password logins as soon as you set a Passkey. And so does Sony on their recently introduced Passkeys for PS5. I believe this should be how it’s done. Passkeys are here to eliminate passwords and improve security. By keeping the ability to login with a password there’s no security benefit gained. |
Do you mean the option is gone from the form? Or you just get denied if you try to enter a username/password? |
I have a PS account so I could test that myself. It seems that you have to enter your username first, then it gives you the appropriate option. e.g. I entered my email then it showed me the option to sign in with a passkey. I tried again with a fake email and it shows me the password field. |
Nice I love inconsistency. So I think maybe we do this: Have an I assume the difference across the sites is because of different requirements on a per-company scope. Some might like it one way, others not. This options should allow most situations:
|
That sounds like a perfect solution. For example, I would enforce it by default. But maybe not if I’d use the 2fa addon. All options possible. I love it. |
Sounds good to me too. Let me know if you want me to update this to work that way. |
@jasonvarga I've updated this:
|
That sort of UI change is above my pay grade :) |
I'll chip in £5 |
Co-Authored-By: Rob de Kort <[email protected]>
Some icons on those flat buttons might be the icing on the cake, but I don't have access to streamline. |
This PR adds WebAuthn/Passkey support to the CP login:
CleanShot.2023-12-22.at.08.12.14.mp4
We make use of the following libraries for backend and front end support respectively:
https://github.com/web-auth/webauthn-lib
https://simplewebauthn.dev/docs/packages/browser/
I noticed CraftCMS have used the same libraries for their Passkey support.
The user flow is as follows:
The changes behind the scenes are:
- There is a new passkeys stache store (inside a new passkeys folder in the users folder)- There is a passkeys repository and query builder to allow querying of a user's passkeysI still need to add support for eloquent stored passkeys, andthe UI on the passkeys page in the CP could do with being improved by someone who has better design skills than me.Closes statamic/ideas#1059