FusionAuth
    • Home
    • Categories
    • Recent
    • Popular
    • Pricing
    • Contact us
    • Docs
    • Login
    1. Home
    2. Tags
    3. webauthn
    Log in to post
    • All categories
    • danD

      Solved Wanted to add a passkey prompt in my application

      Q&A
      • passkeys webauthn prompt • • dan
      2
      0
      Votes
      2
      Posts
      61
      Views

      danD

      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.

    • danD

      Solved Can I do a step up authentication with WebAuthn/passkeys?

      Q&A
      • webauthn passkeys step-up • • dan
      2
      0
      Votes
      2
      Posts
      1.5k
      Views

      danD

      We have an open issue to make passkeys one of the supported MFA methods.

      But you can perform a step up passkey challenge using the APIs or the SDKs by doing the following:

      User tries to access a restricted resource Customer app sees if the user has already been granted access (via the presence of a cookie, or some other mechanism). If they have, let them through. If the user hasn’t been granted access, perform a webauthn assertion workflow Call the /api/webauthn/start to get the workflow started Interact with the authenticator to produce the signature and whatever other information is needed. This is authenticator-specific. Call the /api/webauthn/assert to complete the workflow and prove possession of the authenticator If the workflow is successful Write a cookie or whatever if you want to remember this permission Let the user through If the workflow isn’t successful Deny access

      If someone doesn't have a passkey enabled, which you can check by calling the /api/webauthn?userId={userId} API, direct them to the self-service account management passkey management pages.

      Here are the API docs for the webauthn API.