クラス OAuth2LoginReactiveAuthenticationManager
java.lang.ObjectSE
org.springframework.security.oauth2.client.authentication.OAuth2LoginReactiveAuthenticationManager
- 実装されているすべてのインターフェース:
ReactiveAuthenticationManager
public class OAuth2LoginReactiveAuthenticationManager
extends ObjectSE
implements ReactiveAuthenticationManager
OAuth 2.0 認証コード付与フローを活用する OAuth 2.0 ログイン用の
AuthenticationProvider の実装。この AuthenticationProvider は、認証サーバーのトークンエンドポイントを使用して認証コードのクレデンシャルを認証し、有効な場合はアクセストークンのクレデンシャルと交換するロールを果たします。 また、OAuth2UserService を使用して UserInfo エンドポイントからエンドユーザー(リソース所有者)のユーザー属性を取得し、OAuth2User の形式で Principal を作成します。次に、OAuth2User が OAuth2LoginAuthenticationToken に関連付けられ、認証が完了します。
コンストラクターの概要
コンストラクターコンストラクター説明OAuth2LoginReactiveAuthenticationManager(ReactiveOAuth2AccessTokenResponseClient<OAuth2AuthorizationCodeGrantRequest> accessTokenResponseClient, ReactiveOAuth2UserService<OAuth2UserRequest, OAuth2User> userService) メソッドのサマリー
修飾子と型メソッド説明reactor.core.publisher.Mono<Authentication>authenticate(Authentication authentication) 提供されたAuthenticationを認証しようとしますfinal voidsetAuthoritiesMapper(GrantedAuthoritiesMapper authoritiesMapper) OAuth2AuthenticatedPrincipal.getAuthorities()をOAuth2LoginAuthenticationTokenに関連付けられる新しい権限のセットにマッピングするために使用されるGrantedAuthoritiesMapperを設定します。
コンストラクターの詳細
OAuth2LoginReactiveAuthenticationManager
public OAuth2LoginReactiveAuthenticationManager(ReactiveOAuth2AccessTokenResponseClient<OAuth2AuthorizationCodeGrantRequest> accessTokenResponseClient, ReactiveOAuth2UserService<OAuth2UserRequest, OAuth2User> userService)
メソッドの詳細
authenticate
インターフェースからコピーされた説明:ReactiveAuthenticationManager提供されたAuthenticationを認証しようとします- 次で指定:
- インターフェース
ReactiveAuthenticationManagerのauthenticate - パラメーター:
authentication- テストするAuthentication- 戻り値:
- 認証が成功すると、
Authenticationが返されます。認証を判別できない場合、空の Mono が返されます。認証が失敗すると、Mono エラーが返されます。
setAuthoritiesMapper
OAuth2AuthenticatedPrincipal.getAuthorities()をOAuth2LoginAuthenticationTokenに関連付けられる新しい権限のセットにマッピングするために使用されるGrantedAuthoritiesMapperを設定します。- パラメーター:
authoritiesMapper- ユーザーの権限のマッピングに使用されるGrantedAuthoritiesMapper- 導入:
- 5.4