Browse all series

Add Passkeys to a Laravel App

Passkeys provide a simpler and more secure alternative to traditional passwords. Neat, but there's only one problem: the implementation instructions are incredibly complicated. Don't worry, I know the feeling. In this series, work along with me to bring passkeys to Laravel, and gain all the insight you'll need to add passkeys to your own applications!

Progress

Series Info

Episodes
7
Run Time
1h 25m
Difficulty
Advanced
Last Updated
Oct 14, 2024
Version
Webauthn Framework V4

Series Episodes

  1. Models and Migrations (1)
    1. The Passkey Model

      If we're going to integrate passkeys, we'll need somewhere to store them. Let's set up a Passkey model that will represent the keys users add to their accounts. We can also wire up the profile page to display a user's passkeys.
  2. Creating a Passkey (2)
    1. Passkey Options

      You'd be forgiven for thinking that creating a passkey is as simple as asking for one in JavaScript before firing it off to our server, but there's an important we need to execute beforehand: asking our server for WebAuthn options. Let's talk about why and how in this episode.
    2. Storing a Passkey

      With our frontend successfully generating passkeys, we need to send the data to our server to validate and store ready for authentication. Let's walk through the process step by step until we have a fully functioning implementation!
  3. Authenticating a Passkey (3)
    1. Give Me a Challenge

      Let's turn our focus to authenticating using passkeys. The first thing we need to do is ask our server for a challenge that a potential passkey can answer. This will allow our server to ensure you are who you say you are. Let's go ahead and add a new API route for generating one.
    2. Meeting the Challenge

      Our passkey has answered the challenge, but who's to judge if it's worthy? That's the job of our server, so let's work on our final endpoint that will validate the answer and log in our user. You're almost password free, amigo!
    3. The Final Hurdle

      There are times where your user will need to enter their username manually whilst still authenticating with a passkey. For those times, we need to implement a fallback method in our login form. Let's tackle this final hurdle together with a little bit of Alpine magic.
  4. Supplementary (1)
    1. Upgrading to Webauthn Framework V5!

      As can happen from time to time, since recording this series, a new major version of the Webauthn Framework package has been released. As part of this release, a handful of breaking changes were introduced. Let's update our codebase to accomodate these changes.

Continue Learning