Authentication Policy設定ガイド
このドキュメントの目的
認証ポリシー(Authentication Policy)の設定方法を理解します。
所要時間
⏱️ 約25分
Authentication Policyとは
認証 ポリシーはフロー別の認証要件を定義します。
設定内容:
- 利用可能な認証方式
- ACR(Authentication Context Class Reference)マッピング
- 成功条件・失敗条件・ロック条件
設定ファイル構造
authentication-policy/oauth.json
{
"id": "f0864ea0-c4a0-470f-af92-22f995c80b3a",
"flow": "oauth",
"enabled": true,
"policies": [
{
"description": "default",
"priority": 1,
"conditions": {},
"available_methods": [
"password",
"email",
"fido-uaf"
],
"acr_mapping_rules": {
"urn:mace:incommon:iap:gold": ["fido-uaf", "fido2"],
"urn:mace:incommon:iap:silver": ["email", "sms"],
"urn:mace:incommon:iap:bronze": ["password"]
},
"success_conditions": {
"any_of": [
[
{
"path": "$.password-authentication.success_count",
"type": "integer",
"operation": "gte",
"value": 1
}
]
]
},
"failure_conditions": {
"any_of": []
},
"lock_conditions": {
"any_of": []
}
}
]
}
主要なフィールド
ポリシー基本情報
| フィールド | 必須 | 説明 | 例 |
|---|---|---|---|
id | ✅ | ポリシーID(UUID) | f0864ea0-... |
flow | ✅ | 対象フロー | oauth / ciba |
enabled | ✅ | 有効/無効 | true / false |
policies | ✅ | ポリシーリスト | 配列 |
Policyオブジェクト
| フィールド | 必須 | 説明 |
|---|---|---|
description | ❌ | ポリシー説明 |
priority | ✅ | 優先度(高い値が優先) |
conditions | ❌ | 適用条件 |
available_methods | ✅ | UIに表示する認証方式(UIヒント) |
acr_mapping_rules | ❌ | ACRマッピング |
step_definitions | ❌ | 多段階認証のステップ定義 |
success_conditions | ✅ | 成功条件 |
failure_conditions | ❌ | 失敗条件 |
lock_conditions | ❌ | ロック条件 |
auth_session_binding_required | ❌ | セッションバインディング(デフォルト: true) |
Available Methods
UIに表示する認証方式を指定します。この設定はUIヒントとして機能し、フロントエンドが認証画 面で表示する認証方式を決定するために使用されます。
{
"available_methods": [
"password",
"email",
"fido-uaf",
"fido2"
]
}
重要:
- この設定はバックエンドでの認証方式の制限には使用されません
- 認証の成功条件は
success_conditionsで制御してください - Authentication Configuration で登録済みの認証方式のみ指定可能
ACR Mapping Rules
ACR値と認証方式のマッピング:
{
"acr_mapping_rules": {
"urn:mace:incommon:iap:gold": ["fido-uaf", "fido2"],
"urn:mace:incommon:iap:silver": ["email", "sms"],
"urn:mace:incommon:iap:bronze": ["password"]
}
}
動作:
- クライアントが
acr_values=urn:mace:incommon:iap:goldを要求 → FIDO-UAFまたはWebAuthn認証が必要
Success Conditions
認証成功の条件をJSONPathで定義:
{
"success_conditions": {
"any_of": [
[
{
"path": "$.password-authentication.success_count",
"type": "integer",
"operation": "gte",
"value": 1
}
],
[
{
"path": "$.email-authentication.success_count",
"type": "integer",
"operation": "gte",
"value": 1
},
{
"path": "$.fido-uaf-authentication.success_count",
"type": "integer",
"operation": "gte",
"value": 1
}
]
]
}
}
意味:
- パスワード認証成功 OR(Email認証成功 AND FIDO-UAF認証成功)
サポートされる演算子
| 演算子 | 説明 | 例 |
|---|---|---|
gte | 以上 | success_count >= 1 |
lte | 以下 | failure_count <= 3 |
eq | 等しい | status == "verified" |
ne | 等しくない | status != "locked" |