クラス OpenSamlAuthenticationTokenConverter
java.lang.ObjectSE
org.springframework.security.saml2.provider.service.web.OpenSamlAuthenticationTokenConverter
- 実装されたすべてのインターフェース:
AuthenticationConverter
public final class OpenSamlAuthenticationTokenConverter
extends ObjectSE
implements AuthenticationConverter
AuthenticationManager
に対する認証済み SAML 2.0 アサーションに適した Saml2AuthenticationToken
を生成する AuthenticationConverter
。- 導入:
- 6.1
コンストラクターのサマリー
コンストラクターメソッドのサマリー
修飾子と型メソッド説明convert
(jakarta.servlet.http.HttpServletRequest request) 指定されたHttpServletRequest
からの認証リクエストを解決します。void
setAuthenticationRequestRepository
(Saml2AuthenticationRequestRepository<AbstractSaml2AuthenticationRequest> authenticationRequestRepository) 指定されたSaml2AuthenticationRequestRepository
を使用して、認証リクエストをロードします。void
setRequestMatcher
(RequestMatcher requestMatcher) 指定されたRequestMatcher
を使用してリクエストに一致します。
コンストラクターの詳細
OpenSamlAuthenticationTokenConverter
RelyingPartyRegistration
のリポジトリを指定してOpenSamlAuthenticationTokenConverter
を構築します- パラメーター:
registrations
-RelyingPartyRegistration
RelyingPartyRegistration
のリポジトリ
メソッドの詳細
convert
指定されたHttpServletRequest
からの認証リクエストを解決します。まず、構成された
RequestMatcher
を使用して、認証リクエストが行われているかどうか、またオプションでどのregistrationId
に対して認証リクエストが行われているかを推定します。関連付けられた
<saml2:AuthnRequest>
がある場合は、registrationId
が検索されて使用されます。リクエスト内で
registrationId
が見つかると、それが検索されて使用されます。この場合、何も見つからないとSaml2AuthenticationException
がスローされます。最後に、リクエスト内に
registrationId
が見つからない場合、コードは SAML レスポンスの発行者からRelyingPartyRegistration
を解決しようとします。- 次で指定:
- インターフェース
AuthenticationConverter
のconvert
- パラメーター:
request
- HTTP リクエスト- 戻り値:
Saml2AuthenticationToken
認証リクエスト- 例外:
Saml2AuthenticationException
-RequestMatcher
が存在しないregistrationId
を指定している場合
setAuthenticationRequestRepository
public void setAuthenticationRequestRepository(Saml2AuthenticationRequestRepository<AbstractSaml2AuthenticationRequest> authenticationRequestRepository) 指定されたSaml2AuthenticationRequestRepository
を使用して、認証リクエストをロードします。- パラメーター:
authenticationRequestRepository
- 使用するSaml2AuthenticationRequestRepository
setRequestMatcher
指定されたRequestMatcher
を使用してリクエストに一致します。- パラメーター:
requestMatcher
- 使用するRequestMatcher