クラス 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 実装。
導入:
7.0
関連事項:
  • コンストラクターの詳細

    • OAuth2ClientRegistrationAuthenticationProvider

      public OAuth2ClientRegistrationAuthenticationProvider(RegisteredClientRepository registeredClientRepository, OAuth2AuthorizationService authorizationService)
      指定されたパラメーターを使用して OAuth2ClientRegistrationAuthenticationProvider を構築します。
      パラメーター:
      registeredClientRepository - 登録済みクライアントのリポジトリ
  • メソッドの詳細

    • authenticate

      public Authentication authenticate(Authentication authentication) throws AuthenticationException
      インターフェースからコピーされた説明: AuthenticationProvider
      AuthenticationManager.authenticate(Authentication) と同じ契約で認証を実行します。
      次で指定:
      インターフェース AuthenticationProviderauthenticate 
      パラメーター:
      authentication - 認証リクエストオブジェクト。
      戻り値:
      資格情報を含む完全に認証されたオブジェクト。AuthenticationProvider が、渡された Authentication オブジェクトの認証をサポートできない場合、null を返すことがあります。そのような場合、提示された Authentication クラスをサポートする次の AuthenticationProvider が試行されます。
      例外:
      AuthenticationException - 認証が失敗した場合。
    • supports

      public boolean supports(ClassSE<?> authentication)
      インターフェースからコピーされた説明: AuthenticationProvider
      この AuthenticationProvider が指定された Authentication オブジェクトをサポートする場合、true を返します。

      true を返しても、AuthenticationProvider が提示された Authentication オブジェクトを認証できることは保証されません。これは単に、より詳細な評価をサポートできることを示しているだけです。AuthenticationProvider は、AuthenticationProvider.authenticate(Authentication) メソッドから null を返して、別の AuthenticationProvider を試す必要があることを示すことができます。

      認証を実行できる AuthenticationProvider の選択は、実行時に ProviderManager によって行われます。

      次で指定:
      インターフェース AuthenticationProvidersupports 
      戻り値:
      実装が提示された Authentication クラスをより厳密に評価できる場合は true 
    • setRegisteredClientConverter

      public void setRegisteredClientConverter(org.springframework.core.convert.converter.Converter<OAuth2ClientRegistration,RegisteredClient> registeredClientConverter)
      OAuth2ClientRegistrationRegisteredClient に変換するために使用される Converter を設定します。
      パラメーター:
      registeredClientConverter - OAuth2ClientRegistrationRegisteredClient に変換するために使用される Converter 
    • setClientRegistrationConverter

      public void setClientRegistrationConverter(org.springframework.core.convert.converter.Converter<RegisteredClient,OAuth2ClientRegistration> clientRegistrationConverter)
      RegisteredClientOAuth2ClientRegistration に変換するために使用される Converter を設定します。
      パラメーター:
      clientRegistrationConverter - RegisteredClientOAuth2ClientRegistration に変換するために使用される Converter 
    • setPasswordEncoder

      public void setPasswordEncoder(PasswordEncoder passwordEncoder)
      client secret をエンコードするために使用する PasswordEncoder を設定します。設定されていない場合、クライアントシークレットは PasswordEncoderFactories.createDelegatingPasswordEncoder() を使用してエンコードされます。
      パラメーター:
      passwordEncoder - クライアントシークレットをエンコードするために使用される PasswordEncoder
    • setOpenRegistrationAllowed

      public void setOpenRegistrationAllowed(boolean openRegistrationAllowed)
      オープンクライアント登録(初期アクセストークンなし)を許可する場合は true に設定します。デフォルトは false です。
      パラメーター:
      openRegistrationAllowed - オープンクライアント登録が許可されている場合は true、そうでない場合は false