クラス CasAuthenticationEntryPoint
java.lang.ObjectSE
org.springframework.security.cas.web.CasAuthenticationEntryPoint
- 実装されたすべてのインターフェース:
org.springframework.beans.factory.InitializingBean
,AuthenticationEntryPoint
public class CasAuthenticationEntryPoint
extends ObjectSE
implements AuthenticationEntryPoint, org.springframework.beans.factory.InitializingBean
ExceptionTranslationFilter
が JA-SIG 中央認証サービス(CAS)を介して認証を開始するために使用します。 ユーザーのブラウザーは、JA-SIG CAS エンタープライズ全体のログインページにリダイレクトされます。このページは、loginUrl
プロパティによって指定されます。ログインが完了すると、CAS ログインページは service
プロパティで指定されたページにリダイレクトされます。service
は、現在のアプリケーションに属する HTTP URL です。service
URL は CasAuthenticationFilter
によって監視され、CAS ログインが成功したことを検証します。
コンストラクターのサマリー
コンストラクターメソッドのサマリー
修飾子と型メソッド説明void
final void
commence
(jakarta.servlet.http.HttpServletRequest servletRequest, jakarta.servlet.http.HttpServletResponse response, AuthenticationException authenticationException) 認証スキームを開始します。protected StringSE
createRedirectUrl
(StringSE serviceUrl) CAS サーバーへのリダイレクト用の URL を作成します。protected StringSE
createServiceUrl
(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) 新しいサービス URL を構築します。protected boolean
サービス ID をセッション ID でエンコードするかどうかを設定します。final StringSE
企業全体の CAS ログイン URL。final ServiceProperties
protected void
preCommence
(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) リダイレクトが発生する前に独自の前処理を行うためのテンプレートメソッド。final void
setEncodeServiceUrlWithSessionId
(boolean encodeServiceUrlWithSessionId) サービス ID をセッション ID でエンコードするかどうかを設定します。final void
setLoginUrl
(StringSE loginUrl) void
setRedirectStrategy
(RedirectStrategy redirectStrategy) RedirectStrategy
を使用するように設定するfinal void
setServiceProperties
(ServiceProperties serviceProperties)
コンストラクターの詳細
CasAuthenticationEntryPoint
public CasAuthenticationEntryPoint()
メソッドの詳細
afterPropertiesSet
public void afterPropertiesSet()- 次で指定:
- インターフェース
org.springframework.beans.factory.InitializingBean
のafterPropertiesSet
commence
public final void commence(jakarta.servlet.http.HttpServletRequest servletRequest, jakarta.servlet.http.HttpServletResponse response, AuthenticationException authenticationException) throws IOExceptionSE インターフェースからコピーされた説明:AuthenticationEntryPoint
認証スキームを開始します。ExceptionTranslationFilter
は、このメソッドを呼び出す前に、AbstractAuthenticationProcessingFilter.SPRING_SECURITY_SAVED_REQUEST_KEY
という名前のHttpSession
属性にリクエストされたターゲット URL を入力します。実装では、必要に応じて
ServletResponse
のヘッダーを変更して、認証プロセスを開始する必要があります。- 次で指定:
- インターフェース
AuthenticationEntryPoint
のcommence
- パラメーター:
servletRequest
-AuthenticationException
が発生したリクエストresponse
- ユーザーエージェントが認証を開始できるようにするauthenticationException
- 呼び出しの原因となった例外- 例外:
IOExceptionSE
createServiceUrl
protected StringSE createServiceUrl(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) 新しいサービス URL を構築します。デフォルトの実装では、大部分の作業を CAS クライアントに依存しています。- パラメーター:
request
- HttpServletRequestresponse
- HttpServlet レスポンス- 戻り値:
- 構築されたサービス URL。NULL にすることはできません。
createRedirectUrl
CAS サーバーへのリダイレクト用の URL を作成します。デフォルトの実装では、大部分の作業を CAS クライアントに依存しています。- パラメーター:
serviceUrl
- 含める必要があるサービスの URL。- 戻り値:
- リダイレクト URL。NULL にすることはできません。
preCommence
protected void preCommence(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) リダイレクトが発生する前に独自の前処理を行うためのテンプレートメソッド。- パラメーター:
request
- HttpServletRequestresponse
- HttpServletResponse
getLoginUrl
企業全体の CAS ログイン URL。通常はhttps://www.mycompany.com/cas/login
のようなものです。- 戻り値:
- 企業全体の CAS ログイン URL
getServiceProperties
setLoginUrl
setServiceProperties
setEncodeServiceUrlWithSessionId
public final void setEncodeServiceUrlWithSessionId(boolean encodeServiceUrlWithSessionId) サービス ID をセッション ID でエンコードするかどうかを設定します。- パラメーター:
encodeServiceUrlWithSessionId
- サービス ID をセッション ID でエンコードするかどうか。
getEncodeServiceUrlWithSessionId
protected boolean getEncodeServiceUrlWithSessionId()サービス ID をセッション ID でエンコードするかどうかを設定します。- 戻り値:
- サービス ID をセッション ID でエンコードするかどうか。
setRedirectStrategy
RedirectStrategy
を使用するように設定する- パラメーター:
redirectStrategy
- 使用するRedirectStrategy
- 導入:
- 6.3