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