クラス OAuth2LoginAuthenticationFilter

    • フィールドの詳細

      • DEFAULT_FILTER_PROCESSES_URI

        public static final java.lang.String DEFAULT_FILTER_PROCESSES_URI
        この Filter が認証リクエストを処理するデフォルトの URI
        関連事項:
        定数フィールド値
    • コンストラクターの詳細

      • OAuth2LoginAuthenticationFilter

        public OAuth2LoginAuthenticationFilter​(ClientRegistrationRepository clientRegistrationRepository,
                                               OAuth2AuthorizedClientService authorizedClientService)
        指定されたパラメーターを使用して OAuth2LoginAuthenticationFilter を構築します。
        パラメーター:
        clientRegistrationRepository - クライアント登録のリポジトリ
        authorizedClientService - 認可されたクライアントサービス
      • OAuth2LoginAuthenticationFilter

        public OAuth2LoginAuthenticationFilter​(ClientRegistrationRepository clientRegistrationRepository,
                                               OAuth2AuthorizedClientService authorizedClientService,
                                               java.lang.String filterProcessesUrl)
        指定されたパラメーターを使用して OAuth2LoginAuthenticationFilter を構築します。
        パラメーター:
        clientRegistrationRepository - クライアント登録のリポジトリ
        authorizedClientService - 認可されたクライアントサービス
        filterProcessesUrl - この Filter が認証リクエストを処理する URI 
      • OAuth2LoginAuthenticationFilter

        public OAuth2LoginAuthenticationFilter​(ClientRegistrationRepository clientRegistrationRepository,
                                               OAuth2AuthorizedClientRepository authorizedClientRepository,
                                               java.lang.String filterProcessesUrl)
        指定されたパラメーターを使用して OAuth2LoginAuthenticationFilter を構築します。
        パラメーター:
        clientRegistrationRepository - クライアント登録のリポジトリ
        authorizedClientRepository - 認可されたクライアントリポジトリ
        filterProcessesUrl - この Filter が認証リクエストを処理する URI 
        導入:
        5.1
    • メソッドの詳細

      • attemptAuthentication

        public Authentication attemptAuthentication​(javax.servlet.http.HttpServletRequest request,
                                                    javax.servlet.http.HttpServletResponse response)
                                             throws AuthenticationException
        クラスからコピーされた説明: AbstractAuthenticationProcessingFilter
        実際の認証を実行します。

        実装では、次のいずれかを実行する必要があります。

        1. 認証されたユーザーの移入された認証トークンを返し、認証の成功を示します
        2. 認証プロセスがまだ進行中であることを示す null を返します。戻る前に、実装はプロセスを完了するために必要な追加作業を実行する必要があります。
        3. 認証プロセスが失敗した場合、 AuthenticationException をスローします
        次で指定:
        クラス AbstractAuthenticationProcessingFilterattemptAuthentication 
        パラメーター:
        request - パラメーターの抽出元および認証の実行元
        response - レスポンス。実装がマルチステージ認証プロセス(OpenID など)の一部としてリダイレクトを行う必要がある場合に必要になる場合があります。
        戻り値:
        認証されたユーザートークン。認証が不完全な場合は null
        例外:
        AuthenticationException - 認証が失敗した場合。