Wanted to add a passkey prompt in my application
-
I have an application using FusionAuth, and I want to prompt my end users to set up passkeys. Having this authentication method will improve their security and ease their future logins.
I know I can enable passkeys for FusionAuth using the community edition license, but how can I add a prompt in my application code/UI to have them set it up?
-
This is totally possible.
You want to start by understanding FusionAuth passkey setup and the normal flow.
Then, in your application, probably using one of the client libraries, you want to do the following for a user:
- see if a user has a passkey set up, using the "retrieve a passkey" API. If this returns 0 passkeys, show the prompt.
- for the prompt, you have two options:
- use the API/client library to start the passkey registration process from within your application directly
- send them to the user management page to add a passkey (requires a paid license)
The right way to do the latter depends on your application needs (are you okay with a redirect) and whether or not you have at least a starter license.
For reporting on the number of users that have set up passkeys, unfortunately you have to query all your users and then pull the passkey data individually. There's no way to use the elasticsearch syntax to do the query as of yet. There's an open github issue to add that functionality.
-
D dan has marked this topic as solved