クラス OpaqueTokenReactiveAuthenticationManager
java.lang.ObjectSE
org.springframework.security.oauth2.server.resource.authentication.OpaqueTokenReactiveAuthenticationManager
- 実装されているすべてのインターフェース:
ReactiveAuthenticationManager
public class OpaqueTokenReactiveAuthenticationManager
extends ObjectSE
implements ReactiveAuthenticationManager
不透明なベアラートークンの
ReactiveAuthenticationManager 実装。OAuth 2.0 イントロスペクションエンドポイントを使用してトークンの有効性を確認し、その属性を明らかにします。 この ReactiveAuthenticationManager は、不透明なアクセストークンのイントロスペクトと検証を行い、Authentication ステートメントの一部として設定された属性を返します。
ReactiveOpaqueTokenIntrospector は、認可サーバーからトークン属性を取得するロールを果たします。
ReactiveOpaqueTokenAuthenticationConverter は、成功したイントロスペクションの結果を Authentication インスタンスに変換する責任があります (これには、トークン属性からの GrantedAuthority のマッピングまたは別のソースからの取得が含まれる場合があります)。
- 導入:
- 5.2
- 関連事項:
コンストラクターの概要
コンストラクターコンストラクター説明指定されたパラメーターでOpaqueTokenReactiveAuthenticationManagerを作成します方法の概要
修飾子と型メソッド説明reactor.core.publisher.Mono<Authentication>authenticate(Authentication authentication) 不透明なベアラートークンをイントロスペクトして検証し、Authenticationのインスタンス化をReactiveOpaqueTokenAuthenticationConverterに委譲します。voidsetAuthenticationConverter(ReactiveOpaqueTokenAuthenticationConverter authenticationConverter) カスタム Bean を提供して、成功したイントロスペクション結果を選択したAuthenticationインスタンスに変換します。
コンストラクターの詳細
OpaqueTokenReactiveAuthenticationManager
指定されたパラメーターでOpaqueTokenReactiveAuthenticationManagerを作成します- パラメーター:
introspector- 使用するReactiveOpaqueTokenIntrospector
メソッドの詳細
authenticate
不透明なベアラートークンをイントロスペクトして検証し、Authenticationのインスタンス化をReactiveOpaqueTokenAuthenticationConverterに委譲します。作成された認証が
AbstractAuthenticationTokenのインスタンスで詳細が null の場合、イントロスペクション結果の詳細が使用されます。- 次で指定:
- インターフェース
ReactiveAuthenticationManagerのauthenticate - パラメーター:
authentication- 認証リクエストオブジェクト。- 戻り値:
- 成功した認証
setAuthenticationConverter
public void setAuthenticationConverter(ReactiveOpaqueTokenAuthenticationConverter authenticationConverter) カスタム Bean を提供して、成功したイントロスペクション結果を選択したAuthenticationインスタンスに変換します。デフォルトでは、BearerTokenAuthenticationがビルドされます。- パラメーター:
authenticationConverter- 使用するコンバーター- 導入:
- 5.8