認証インタラクター
目的
AuthenticationInteractorは、各種認証方式(Password、WebAuthn、SMS、Email、Device等)の認証フローを実装するためのインターフェースです。
このガイドは、新しい認証方式を追加する開発者向けの標準手順・設計指針を示します。
前提知識
このガイドを読む前に:
- impl-05-authentication-policy.md - 認証ポリシー
AuthenticationInteractor インターフェース
情報源: AuthenticationInteractor.java:23-40
public interface AuthenticationInteractor {
// ✅ インタラクションタイプ
AuthenticationInteractionType type();
// ✅ オペレーションタイプ(デフォルト: AUTHENTICATION)
default OperationType operationType() {
return OperationType.AUTHENTICATION;
}
// ✅ 認証方式名(AMR値)
String method();
// ✅ 認証インタラクション実行
AuthenticationInteractionRequestResult interact(
Tenant tenant,
AuthenticationTransaction transaction,
AuthenticationInteractionType type,
AuthenticationInteractionRequest request,
RequestAttributes requestAttributes,
UserQueryRepository userQueryRepository);
}
重要ポイント:
- ✅ operationType()はdefaultメソッド: Challenge専用Interactorのみオーバーライド
- ✅ method(): RFC 8176準拠のAMR値を返す
- ✅ interact(): Tenant第一引数(マルチテナント分離)