This is a simple example of WebAuthn and Passkey authentication using Go and JavaScript from my blog post PassKey in Go.
Important
I created a simple library based on this demonstration. It allows you to quickly and easily add Passkey support to your Golang application. The library includes fixes for errors made in this tutorial. Check this out!
Screen.Recording.2024-02-24.at.19.16.37.mov
Set host and port by ENV vars PROTO
, HOST
and PORT
or use default http://localhost:8080
Run server: go run .
- Go WebAuthn lib: https://github.com/go-webauthn/webauthn
- JS lib to use WebAuthn browser API: https://simplewebauthn.dev/docs/packages/browser
- Node + Passkey tutorial https://www.corbado.com/blog/passkey-tutorial-how-to-implement-passkeys