クラス OpenIDAuthenticationProvider

  • 実装されたすべてのインターフェース:
    org.springframework.beans.factory.InitializingBeanAuthenticationProvider

    @Deprecated
    public class OpenIDAuthenticationProvider
    extends java.lang.Object
    implements AuthenticationProvider, org.springframework.beans.factory.InitializingBean
    使用すべきではありません。
    OpenID 1.0 および 2.0 プロトコルは非推奨になり、ユーザーは spring-security-oauth2 でサポートされる OpenID Connect移行することをお勧めします。
    認証済みユーザーのローカル権限を取得することにより、OpenID 認証を完了します。

    権限は、構成された UserDetailsService を呼び出すことによって取得されます。返される UserDetails には、少なくとも、認証されたユーザーに適用可能なユーザー名と GrantedAuthority オブジェクトが含まれている必要があります。デフォルトでは、Spring Security はパスワードと UserDetails の有効 / 無効ステータスを無視します。これは認証に関連し、別のプロバイダーサーバーによって強制されているはずです。

    実装によって返される UserDetails は、生成された Authentication トークンに格納されるため、メールアドレス、電話番号などの追加のプロパティを簡単に格納できます。

    • コンストラクターの詳細

      • OpenIDAuthenticationProvider

        public OpenIDAuthenticationProvider()
        使用すべきではありません。
    • メソッドの詳細

      • afterPropertiesSet

        public void afterPropertiesSet()
        使用すべきではありません。
        次で指定:
        インターフェース org.springframework.beans.factory.InitializingBeanafterPropertiesSet 
      • authenticate

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

        protected Authentication createSuccessfulAuthentication​(UserDetails userDetails,
                                                                OpenIDAuthenticationToken auth)
        使用すべきではありません。
        プロバイダーから返される最終的な Authentication オブジェクトの作成を処理します。

        デフォルトの実装は、オリジナルから新しい OpenIDAuthenticationToken を作成するだけですが、UserDetails をプリンシパルとして使用し、UserDetailsService によってロードされた権限を含めます。

        パラメーター:
        userDetails - ロードされた UserDetails オブジェクト
        auth - 認証メソッドに渡されるトークン
        戻り値:
        認証されたユーザーを表すトークン。
      • setUserDetailsService

        public void setUserDetailsService​(UserDetailsService userDetailsService)
        使用すべきではありません。
        認証された OpenID ユーザーの UserDetails をロードするために使用されます。
      • setAuthenticationUserDetailsService

        public void setAuthenticationUserDetailsService​(AuthenticationUserDetailsService<OpenIDAuthenticationToken> userDetailsService)
        使用すべきではありません。
        認証された OpenID ユーザーの UserDetails をロードするために使用されます。
      • supports

        public boolean supports​(java.lang.Class<?> authentication)
        使用すべきではありません。
        インターフェースからコピーされた説明: AuthenticationProvider
        この AuthenticationProvider が指定された Authentication オブジェクトをサポートする場合、true を返します。

        true を返すことは、AuthenticationProvider が Authentication クラスの提示されたインスタンスを認証できることを保証しません。それは、それがより詳細な評価をサポートできることを示しています。AuthenticationProvider は、AuthenticationProvider.authenticate(Authentication) メソッドから null を返して、別の AuthenticationProvider を試す必要があることを示すことができます。

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

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

        public void setAuthoritiesMapper​(GrantedAuthoritiesMapper authoritiesMapper)
        使用すべきではありません。