クラス OAuth2ClientRegistrationAuthenticationProvider
java.lang.ObjectSE
org.springframework.security.oauth2.server.authorization.authentication.OAuth2ClientRegistrationAuthenticationProvider
- 実装済みのインターフェース一覧:
AuthenticationProvider
public final class OAuth2ClientRegistrationAuthenticationProvider
extends ObjectSE
implements AuthenticationProvider
OAuth 2.0 動的クライアント登録エンドポイントの
AuthenticationProvider 実装。コンストラクター概要
コンストラクターコンストラクター説明OAuth2ClientRegistrationAuthenticationProvider(RegisteredClientRepository registeredClientRepository, OAuth2AuthorizationService authorizationService) 指定されたパラメーターを使用してOAuth2ClientRegistrationAuthenticationProviderを構築します。方法の概要
修飾子と型メソッド説明authenticate(Authentication authentication) AuthenticationManager.authenticate(Authentication)と同じ契約で認証を実行します。voidsetClientRegistrationConverter(org.springframework.core.convert.converter.Converter<RegisteredClient, OAuth2ClientRegistration> clientRegistrationConverter) voidsetOpenRegistrationAllowed(boolean openRegistrationAllowed) オープンクライアント登録 (初期アクセストークンなし) が許可されている場合は、trueに設定します。voidsetPasswordEncoder(PasswordEncoder passwordEncoder) client secretをエンコードするために使用されるPasswordEncoderを設定します。voidsetRegisteredClientConverter(org.springframework.core.convert.converter.Converter<OAuth2ClientRegistration, RegisteredClient> registeredClientConverter) booleanこのAuthenticationProviderが指定されたAuthenticationオブジェクトをサポートしている場合は、trueを返します。
コンストラクターの詳細
OAuth2ClientRegistrationAuthenticationProvider
public OAuth2ClientRegistrationAuthenticationProvider(RegisteredClientRepository registeredClientRepository, OAuth2AuthorizationService authorizationService) 指定されたパラメーターを使用してOAuth2ClientRegistrationAuthenticationProviderを構築します。- パラメーター:
registeredClientRepository- 登録済みクライアントのリポジトリ
メソッドの詳細
authenticate
インターフェースからコピーされた説明:AuthenticationProviderAuthenticationManager.authenticate(Authentication)と同じ契約で認証を実行します。- 次で指定:
- インターフェース
AuthenticationProviderのauthenticate - パラメーター:
authentication- 認証リクエストオブジェクト。- 戻り値:
- 資格情報を含む完全に認証されたオブジェクト。
AuthenticationProviderが、渡されたAuthenticationオブジェクトの認証をサポートできない場合、nullを返すことがあります。そのような場合、提示されたAuthenticationクラスをサポートする次のAuthenticationProviderが試行されます。 - 例外:
AuthenticationException- 認証が失敗した場合。
supports
インターフェースからコピーされた説明:AuthenticationProviderこのAuthenticationProviderが指定されたAuthenticationオブジェクトをサポートする場合、trueを返します。trueを返しても、AuthenticationProviderが提示されたAuthenticationオブジェクトを認証できることは保証されません。これは単に、より詳細な評価をサポートできることを示しているだけです。AuthenticationProviderは、AuthenticationProvider.authenticate(Authentication)メソッドからnullを返して、別のAuthenticationProviderを試す必要があることを示すことができます。認証を実行できる
AuthenticationProviderの選択は、実行時にProviderManagerによって行われます。- 次で指定:
- インターフェース
AuthenticationProviderのsupports - 戻り値:
- 実装が提示された
Authenticationクラスをより厳密に評価できる場合はtrue
setRegisteredClientConverter
public void setRegisteredClientConverter(org.springframework.core.convert.converter.Converter<OAuth2ClientRegistration, RegisteredClient> registeredClientConverter) - パラメーター:
registeredClientConverter-OAuth2ClientRegistrationをRegisteredClientに変換するために使用されるConverter
setClientRegistrationConverter
public void setClientRegistrationConverter(org.springframework.core.convert.converter.Converter<RegisteredClient, OAuth2ClientRegistration> clientRegistrationConverter) - パラメーター:
clientRegistrationConverter-RegisteredClientをOAuth2ClientRegistrationに変換するために使用されるConverter
setPasswordEncoder
client secretをエンコードするために使用するPasswordEncoderを設定します。設定されていない場合、クライアントシークレットはPasswordEncoderFactories.createDelegatingPasswordEncoder()を使用してエンコードされます。- パラメーター:
passwordEncoder- クライアントシークレットをエンコードするために使用されるPasswordEncoder
setOpenRegistrationAllowed
public void setOpenRegistrationAllowed(boolean openRegistrationAllowed) オープンクライアント登録(初期アクセストークンなし)を許可する場合はtrueに設定します。デフォルトはfalseです。- パラメーター:
openRegistrationAllowed- オープンクライアント登録が許可されている場合はtrue、そうでない場合はfalse