0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

トナカイ 一頭Advent Calendar 2024

Day 21

SimpleWebAuthnのExampleからコードの流れを追ってみた

Posted at

SimpleWebAuthnのExample

/puclic/index.html (クライアント側)

登録時

  1. fetch('/generate-registration-options')
  2. SimpleWebAuthnBrowser.startRegistration
  3. fetch('/verify-registration')

2回目以降の認証時

  1. fetch('/generate-authentication-options')
  2. SimpleWebAuthnBrowser.startAuthentication
    useAutofill: trueは自動で認証器を選択し、チャレンジを促す
  3. fetch('/verify-registration')

index.ts (サーバー側)

/generate-registration-options

認証器を登録するためのオプション生成

/verify-authentication

ブラウザや認証器から送られてきた認証レスポンスをサーバー側で検証

/generate-authentication-options

登録済みの認証器を使って、ユーザーを認証するためのオプションを生成

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?