FIDO2・WebAuthn仕様の変遷(Level 1 → 2 → 3)
概要
FIDO2は、パスワードレス認証を実現するための標準仕様であり、WebAuthnとCTAPの2つの標準で構成されています。
このドキュメントでは、WebAuthn Level 1、Level 2、Level 3の仕様変遷と、各レベルで追加された主要機能を詳細に解説します。
情報源:
FIDO2とWebAuthn・CTAPの関係
FIDO2の構成要素
┌───────────────────────────────────────────────────┐
│ FIDO2 │
│ ┌─────────────────────┬──────────────────────┐ │
│ │ WebAuthn API │ CTAP │ │
│ │ (ブラウザAPI仕様) │ (認証器通信プロトコル)│ │
│ │ │ │ │
│ │ Level 1 → 2 → 3 │ 2.0 → 2.1 → 2.2 │ │
│ └─────────────────────┴──────────────────────┘ │
└───────────────────────────────────────────────────┘
各標準の役割
| 標準 | 策定組織 | 役割 | バージョン |
|---|---|---|---|
| WebAuthn | W3C | WebブラウザとWebサービス間のAPI仕様 | Level 1 (2019) → Level 2 (2021) → Level 3 (2023) |
| CTAP | FIDO Alliance | クライアント(ブラウザ)と認証器間の通信プロトコル | 2.0 (2018) → 2.1 (2021) → 2.2 (2024予定) |
WebAuthn Level 1(2019年3月 W3C Recommendation)
基本機能
WebAuthn Level 1は、FIDO2の基礎となるコア機能を定義した最初の標準仕様です。
1. コア認証フロー
| フロー | API | 説明 |
|---|---|---|
| 登録(Registration) | navigator.credentials.create() | 新しいクレデンシャル(公開鍵・秘密鍵ペア)を作成 |
| 認証(Authentication) | navigator.credentials.get() | 既存のクレデンシャルで署名して認証 |
2. 認証器タイプ
// Platform Authenticator(内蔵型)
authenticatorSelection: {
authenticatorAttachment: "platform"
}
// Cross-Platform Authenticator(外付け型)
authenticatorSelection: {
authenticatorAttachment: "cross-platform"
}
| 認証器タイプ | 説明 | 例 |
|---|---|---|
| Platform Authenticator | デバイス内蔵の認証器 | Touch ID, Face ID, Windows Hello |
| Cross-Platform Authenticator | 外部接続の認証器 | YubiKey, Titan Key |
3. ユーザー検証(User Verification)
authenticatorSelection: {
userVerification: "required" // 生体認証・PIN必須
// userVerification: "preferred" // 可能なら実行
// userVerification: "discouraged" // 不要
}
4. Attestation(認証器の正当性証明)
attestation: "none" // Attestation不要(最も一般的)
// attestation: "indirect" // 匿名化されたAttestation
// attestation: "direct" // 認証器の証明書チェーン付き
5. 拡張機能(Extensions)の基本フレームワーク
Level 1では拡張機能のフレームワークのみ定義され、具体的な拡張は少数でした。
Level 1の制限事項
- ❌ Resident Key(Discoverable Credential)の明示的な制御パラメータなし
- ❌ Conditional UI(オートフィル)未対応
- ❌ 高度な認証器管理機能なし
- ❌ JSON シリアライゼーション機能なし
WebAuthn Level 2(2021年4月 W3C Recommendation)
主要な追加機能
Level 2では、Level 1の基本機能を拡張し、実用性とセキュリティを大幅に向上させました。
1. Resident Key(Discoverable Credential)の明示的制御
新パラメータ: residentKey
Level 1ではrequireResidentKey(boolean型)のみでしたが、Level 2で3段階の制御が可能になりました。
// Level 1(レガシー)
authenticatorSelection: {
requireResidentKey: true // boolean型のみ
}
// Level 2(標準)
authenticatorSelection: {
residentKey: "required" // 3段階制御
}
| 値 | 動作 | 用途 |
|---|---|---|
"required" | Discoverable必須(作成できない場合はエラー) | パスワードレス認証 |
"preferred" | 可能ならDiscoverable、不可能ならNon-Discoverable | 柔軟な実装 |
"discouraged" | Non-Discoverable推奨(Discoverableも許容) | 2要素認証の2要素目 |
重要な変更点: Level 2から「Client-side discoverable credentials」という正式名称が採用され、residentKeyパラメータが標準化されました。
2. FIDO U2F後方互換性拡張
appid拡張
extensions: {
appid: "https://example.com/u2f-appid.json"
}
| 拡張 | 用途 | 説明 |
|---|---|---|
| appid | 認証時 | FIDO U2Fで登録したクレデンシャルをWebAuthnで使用 |
| appidExclude | 登録時 | FIDO U2Fの既存クレデンシャルと重複登録を防止 |
3. 拡張機能の正式化
Level 2では多数の拡張機能が正式に定義されました。
| 拡張 | 説明 | 用途 |
|---|---|---|
| credProps | クレデンシャルプロパティ取得 | Resident Key作成確認 |
| credProtect | クレデンシャル保護レベル設定 | User Verification要件の強制 |
| uvm | User Verification Method | 使用された検証方法の取得 |
| largeBlob | 大容量データ保存 | 追加データの認証器保存 |
| credBlob | 小容量データ保存 | 認証器に小規模データ保存 |
credProps拡張の実装例
// 登録時
extensions: {
credProps: true
}
// レスポンス
credential.getClientExtensionResults() === {
credProps: {
rk: true // Resident Keyとして作成されたか?
}
}
4. AbortSignal統合(操作中断機能)
const controller = new AbortController();
// WebAuthn操作を中断可能に
navigator.credentials.get({
publicKey: options,
signal: controller.signal
});
// 5秒後に中断
setTimeout(() => controller.abort(), 5000);
用途: タイムアウト処理、ユーザーによる操作キャンセル、複数認証フローの切り替え
5. PRF拡張(Pseudo-Random Function)
extensions: {
prf: {
eval: {
first: new Uint8Array([/* salt */])
}
}
}
用途: 認証器から擬似乱数値を取得(暗号化キー派生等)
Level 2での改善まとめ
| 項目 | Level 1 | Level 2 |
|---|---|---|
| Resident Key制御 | requireResidentKey (boolean) | residentKey (3段階) |
| U2F互換 | なし | appid/appidExclude拡張 |
| 拡張機能 | 基本フレームワークのみ | 多数の実用拡張を正式化 |
| 操作中断 | なし | AbortSignal統合 |
| 自動化サポート | なし | WebDriver統合 |
WebAuthn Level 3(2023年10月 W3C Working Draft → 現行標準)
主要な追加機能
Level 3では、ユーザー体験の大幅改善とマルチデバイス対応が中心テーマです。