クラス Saml2LoginConfigurer<B extends HttpSecurityBuilder<B>>
java.lang.ObjectSE
org.springframework.security.config.annotation.SecurityConfigurerAdapter<DefaultSecurityFilterChain,B>
org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer<T,B>
org.springframework.security.config.annotation.web.configurers.AbstractAuthenticationFilterConfigurer <B, Saml2LoginConfigurer <B>, Saml2WebSsoAuthenticationFilter >
org.springframework.security.config.annotation.web.configurers.saml2.Saml2LoginConfigurer<B>
- 実装されたすべてのインターフェース:
SecurityConfigurer<DefaultSecurityFilterChain,
B>
public final class Saml2LoginConfigurer<B extends HttpSecurityBuilder<B>>
extends AbstractAuthenticationFilterConfigurer<B,Saml2LoginConfigurer<B>,Saml2WebSsoAuthenticationFilter>
SAML 2.0 Web ブラウザーのシングルサインオン(WebSSO)フローを活用する SAML 2.0 ログイン用の
AbstractHttpConfigurer
。SAML 2.0 ログインは、SAML 2.0 ID プロバイダーで既存のアカウントを使用してユーザーにログインさせる機能をアプリケーションに提供します。
すべての構成オプションにデフォルトが提供され、必要な構成は relyingPartyRegistrationRepository(RelyingPartyRegistrationRepository)
のみです。または、代わりに RelyingPartyRegistrationRepository
@Bean
を登録できます。
セキュリティフィルター
次のFilter
が読み込まれます。作成された共有オブジェクト
次の共有オブジェクトが読み込まれます。使用される共有オブジェクト
次の共有オブジェクトが使用されます。RelyingPartyRegistrationRepository
(必須)DefaultLoginPageGeneratingFilter
-loginPage(String)
が設定されておらず、DefaultLoginPageGeneratingFilter
が利用可能な場合、デフォルトのログインページが利用可能になります
コンストラクターのサマリー
メソッドのサマリー
修飾子と型メソッド説明authenticationConverter
(AuthenticationConverter authenticationConverter) 受信リクエストをAuthentication
に変換するときに、このAuthenticationConverter
を使用します。authenticationManager
(AuthenticationManager authenticationManager) SAML 2 認証中にAuthenticationManager
の構成を使用できるようにします。authenticationRequestResolver
(Saml2AuthenticationRequestResolver authenticationRequestResolver) このSaml2AuthenticationRequestResolver
を使用して、SAML 2.0 認証リクエストを生成します。authenticationRequestUri
(StringSE authenticationRequestUri) SAML 認証リクエストの送信先 URL をカスタマイズします。void
SecurityBuilder
に必要なプロパティを設定して、SecurityBuilder
を構成します。protected RequestMatcher
createLoginProcessingUrlMatcher
(StringSE loginProcessingUrl) loginProcessingUrl を指定してRequestMatcher
を作成しますvoid
SecurityBuilder
を初期化します。ログインが必要な場合にユーザーを送信する URL を指定します。loginProcessingUrl
(StringSE loginProcessingUrl) 資格情報を検証する URL を指定します。依存パーティのRelyingPartyRegistrationRepository
を設定します。各パーティは、サービスプロバイダ、SP とこのホスト、ID プロバイダ、相互に通信する IDP ペアを表します。クラス org.springframework.security.config.annotation.web.configurers.AbstractAuthenticationFilterConfigurer から継承されたメソッド
authenticationDetailsSource, defaultSuccessUrl, defaultSuccessUrl, failureHandler, failureUrl, getAuthenticationEntryPoint, getAuthenticationEntryPointMatcher, getAuthenticationFilter, getFailureUrl, getLoginPage, getLoginProcessingUrl, isCustomLoginPage, permitAll, permitAll, registerAuthenticationEntryPoint, registerDefaultAuthenticationEntryPoint, securityContextRepository, setAuthenticationFilter, successHandler, updateAccessDefaults, updateAuthenticationDefaults
クラス org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer から継承されたメソッド
disable, getSecurityContextHolderStrategy, withObjectPostProcessor
クラス org.springframework.security.config.annotation.SecurityConfigurerAdapter から継承されたメソッド
addObjectPostProcessor, and, getBuilder, postProcess, setBuilder
コンストラクターの詳細
Saml2LoginConfigurer
public Saml2LoginConfigurer()
メソッドの詳細
authenticationConverter
public Saml2LoginConfigurer<B> authenticationConverter(AuthenticationConverter authenticationConverter) 受信リクエストをAuthentication
に変換するときに、このAuthenticationConverter
を使用します。デフォルトでは、Saml2AuthenticationTokenConverter
が使用されます。- パラメーター:
authenticationConverter
- 使用するAuthenticationConverter
- 戻り値:
- さらなる構成のための
Saml2LoginConfigurer
- 導入:
- 5.4
authenticationManager
SAML 2 認証中にAuthenticationManager
の構成を使用できるようにします。何も指定されていない場合、システムはそれを作成してSaml2WebSsoAuthenticationFilter
に注入します。- パラメーター:
authenticationManager
- 使用される認証マネージャー- 戻り値:
- さらなる構成のための
Saml2LoginConfigurer
- 例外:
IllegalArgumentExceptionSE
- authenticationManager が null の場合、デフォルトのマネージャーを構成します- 導入:
- 5.3
relyingPartyRegistrationRepository
public Saml2LoginConfigurer<B> relyingPartyRegistrationRepository(RelyingPartyRegistrationRepository repo) 依存パーティのRelyingPartyRegistrationRepository
を設定します。各パーティは、サービスプロバイダ、SP とこのホスト、ID プロバイダ、相互に通信する IDP ペアを表します。- パラメーター:
repo
- 証明書利用者のリポジトリ- 戻り値:
- さらなる構成のための
Saml2LoginConfigurer
loginPage
クラスからコピーされた説明:AbstractAuthenticationFilterConfigurer
ログインが必要な場合にユーザーを送信する URL を指定します。
EnableWebSecurity
で使用すると、この属性が指定されていない場合にデフォルトのログインページが生成されます。URL が指定されている場合、またはこれが
EnableWebSecurity
と組み合わせて使用されていない場合、ユーザーは指定された URL を処理してログインページを生成する必要があります。- オーバーライド:
- クラス
AbstractAuthenticationFilterConfigurer<B extends HttpSecurityBuilder<B>,
のSaml2LoginConfigurer<B extends HttpSecurityBuilder<B>>, Saml2WebSsoAuthenticationFilter> loginPage
authenticationRequestResolver
public Saml2LoginConfigurer<B> authenticationRequestResolver(Saml2AuthenticationRequestResolver authenticationRequestResolver) このSaml2AuthenticationRequestResolver
を使用して、SAML 2.0 認証リクエストを生成します。- パラメーター:
authenticationRequestResolver
-- 戻り値:
- さらなる構成のための
Saml2LoginConfigurer
- 導入:
- 5.7
authenticationRequestUri
SAML 認証リクエストの送信先 URL をカスタマイズします。- パラメーター:
authenticationRequestUri
- SAML 2.0 認証リクエストに使用する URI- 戻り値:
- さらなる構成のための
Saml2LoginConfigurer
- 導入:
- 6.0
loginProcessingUrl
資格情報を検証するための URL を指定します。カスタム URL を指定する場合は、authenticationConverter(AuthenticationConverter)
を介してカスタムAuthenticationConverter
を指定することを検討してください。デフォルトのAuthenticationConverter
実装は、URL に存在する{registrationId}
パス変数に依存しているためです。- オーバーライド:
- クラス
AbstractAuthenticationFilterConfigurer<B extends HttpSecurityBuilder<B>,
のSaml2LoginConfigurer<B extends HttpSecurityBuilder<B>>, Saml2WebSsoAuthenticationFilter> loginProcessingUrl
- パラメーター:
loginProcessingUrl
- 資格情報を検証するための URL- 戻り値:
- 追加のカスタマイズのための
Saml2LoginConfigurer
- 関連事項:
createLoginProcessingUrlMatcher
クラスからコピーされた説明:AbstractAuthenticationFilterConfigurer
loginProcessingUrl を指定してRequestMatcher
を作成します- 次で指定:
- クラス
AbstractAuthenticationFilterConfigurer<B extends HttpSecurityBuilder<B>,
のSaml2LoginConfigurer<B extends HttpSecurityBuilder<B>>, Saml2WebSsoAuthenticationFilter> createLoginProcessingUrlMatcher
- パラメーター:
loginProcessingUrl
- loginProcessingUrl に基づいてRequestMatcher
を作成します- 戻り値:
- loginProcessingUrl に基づいて使用する
RequestMatcher
init
SecurityBuilder
を初期化します。ここでは、共有状態のみを作成および変更する必要がありますが、オブジェクトの構築に使用されるSecurityBuilder
のプロパティは作成および変更しないでください。これにより、構築時にSecurityConfigurer.configure(SecurityBuilder)
メソッドが正しい共有オブジェクトを使用するようになります。ここで設定を適用する必要があります。SAML2 ログイン用にこのフィルターチェーンを初期化します。次のアクションが実行されます。
- WebSSO エンドポイントで CSRF が無効になっています。通常は
/login/saml2/sso
is configured
loginProcessingUrl
が設定されています- カスタムログインページが構成されている、または
- すべての SAML 2.0 ID プロバイダーを含むデフォルトのログインページが構成されます
AuthenticationProvider
が構成されます
- 次で指定:
- インターフェース
SecurityConfigurer<DefaultSecurityFilterChain,
のB extends HttpSecurityBuilder<B>> init
- オーバーライド:
- クラス
AbstractAuthenticationFilterConfigurer<B extends HttpSecurityBuilder<B>,
のSaml2LoginConfigurer<B extends HttpSecurityBuilder<B>>, Saml2WebSsoAuthenticationFilter> init
- 例外:
ExceptionSE
- WebSSO エンドポイントで CSRF が無効になっています。通常は
configure
SecurityBuilder
に必要なプロパティを設定して、SecurityBuilder
を構成します。configure
フェーズでは、SAML 2.0 AuthNRequest リダイレクトを処理するためにSaml2WebSsoAuthenticationRequestFilter
が追加されます- 次で指定:
- インターフェース
SecurityConfigurer<DefaultSecurityFilterChain,
のB extends HttpSecurityBuilder<B>> configure
- オーバーライド:
- クラス
AbstractAuthenticationFilterConfigurer<B extends HttpSecurityBuilder<B>,
のSaml2LoginConfigurer<B extends HttpSecurityBuilder<B>>, Saml2WebSsoAuthenticationFilter> configure
- 例外:
ExceptionSE