自社ブログ記事について、解説用のサンプルコードです。
full-scratch
ディレクトリ- 外部ライブラリを使わず、WebAuthnの登録/認証処理を行うクライアント/サーバーを実装
with-library
ディレクトリ- 外部ライブラリを使って、WebAuthnの登録/認証処理を行うクライアント/サーバーを実装
full-scratch
ディレクトリにおいても、with-library
ディレクトリにおいても、以下の手順で環境構築を行ってください。
- クライアント (
sample-webauthn-app
) の環境構築sample-webauthn-app
ディレクトリに移動npm ci
を実行
- サーバー (
sample-webauthn-server
) の環境構築sample-webauthn-server
ディレクトリに移動pip install -r requirements.txt
を実行
- クライアント (
sample-webauthn-app
) の起動
sample-webauthn-app
ディレクトリに移動npm run dev
を実行
- サーバー (
sample-webauthn-server
) の起動
sample-webauthn-server
ディレクトリに移動python main.py
を実行
- ブラウザで
http://localhost:3000
にアクセス - Name と DisplayName を入力し、Register ボタンをクリック
- 正常に完了したら、「
Successfully registered.
」というステータスメッセージが表示される - 5.を確認した後に、Login ボタンをクリック
- 正常に完了したら、「
Successfully logged in.
」というステータスメッセージが表示される