public class HttpMessageContextWrapper extends ObjectSE implements HttpMessageContext
すべてのメソッドは、デフォルトでラップされたオブジェクトを呼び出します。
コンストラクターと説明 |
---|
HttpMessageContextWrapper(HttpMessageContext httpMessageContext) |
修飾子と型 | メソッドと説明 |
---|---|
void | cleanClientSubject() このコンテキストに関連付けられているサブジェクトをクリーンアップするための便利なメソッド。 |
AuthenticationStatus | doNothing() コンテナーに「何もしない」ように指示します。 |
AuthenticationStatus | forward(StringSE path) サーバー上の別のリソース(Jakarta Servlet、Jakarta Server Pages ファイル、または HTML ファイル)に転送します。 |
AuthenticationParameters | getAuthParameters() SecurityContext#authenticate(AuthParameters)呼び出しで提供されたパラメーターを返します。 |
PrincipalSE | getCallerPrincipal() notifyContainerAboutLogin() の呼び出しによって設定されたプリンシパルを取得します。 |
SubjectSE | getClientSubject() 認証が行われるサブジェクトを返します。 |
SetSE<StringSE> | getGroups() notifyContainerAboutLogin() の呼び出しによって設定されたグループを取得します。 |
CallbackHandlerSE | getHandler() この HttpMessageContext の作成時にランタイムが提供し、このコンテキストが認証の詳細をランタイムに伝達するために使用する低レベルの Jakarta Authentication ハンドラーを返します。 |
MessageInfo | getMessageInfo() 現在のリクエストの低レベルの Jakarta Authentication メッセージ情報インスタンスを返します。 |
HttpServletRequest | getRequest() 現在のリクエストに関連付けられているリクエストオブジェクトを返します。 |
HttpServletResponse | getResponse() 現在のリクエストに関連付けられているレスポンスオブジェクトを返します。 |
HttpMessageContext | getWrapped() |
boolean | isAuthenticationRequest() 認証メカニズムへの現在の呼び出しが、アプリケーションが SecurityContext.authenticate(HttpServletRequest, HttpServletResponse, AuthenticationParameters) を呼び出した結果であるかどうかを確認します |
boolean | isProtected() 現在リクエストされているリソースが保護されているかどうかを確認します。 |
boolean | isRegisterSession() 現在のリクエスト中に認証セッションを登録するようにランタイムがリクエストされているかどうかを確認します。 |
AuthenticationStatus | notifyContainerAboutLogin(CredentialValidationResult result) ID ストアの CredentialValidationResult 結果をコンテナーに直接渡すことを目的とした便利なメソッド。 |
AuthenticationStatus | notifyContainerAboutLogin(PrincipalSE principal, SetSE<StringSE> roles) SecurityContext.isCallerInRole(String) などで使用するためにアプリケーションで使用できるようにするために、指定された呼び出し元のプリンシパルとグループを登録するようにコンテナーに要求します。 |
AuthenticationStatus | notifyContainerAboutLogin(StringSE username, SetSE<StringSE> roles) SecurityContext.isCallerInRole(String) などで使用するためにアプリケーションで使用できるようにするために、指定された呼び出し元の名前とグループを登録するようにコンテナーに要求します。 |
AuthenticationStatus | redirect(StringSE location) レスポンスステータスを SC_FOUND302 に設定します (検出) |
AuthenticationStatus | responseNotFound() レスポンスステータスを 404(見つかりません)に設定します。 |
AuthenticationStatus | responseUnauthorized() レスポンスステータスを 401(未承認)に設定します。 |
void | setRegisterSession(StringSE callerName, SetSE<StringSE> groups) 認証セッションを登録するようにランタイムに要求します。 |
void | setRequest(HttpServletRequest request) リクエストオブジェクトを設定します。 |
void | setResponse(HttpServletResponse response) レスポンスオブジェクトを設定します。 |
HttpMessageContext | withRequest(HttpServletRequest request) リクエストオブジェクトを設定します。 |
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSE
public HttpMessageContextWrapper(HttpMessageContext httpMessageContext)
public HttpMessageContext getWrapped()
public boolean isProtected()
HttpMessageContext
web.xml
。HttpMessageContext
の isProtected
public boolean isAuthenticationRequest()
HttpMessageContext
SecurityContext.authenticate(HttpServletRequest, HttpServletResponse, AuthenticationParameters)
を呼び出した結果であるかどうかを確認します SecurityContext#authenticate が呼び出されなかった場合、認証メカニズムは、リクエストの開始時にコンテナーによって呼び出された可能性があります。
HttpMessageContext
の isAuthenticationRequest
public boolean isRegisterSession()
HttpMessageContext
HttpMessageContext
の isRegisterSession
public void setRegisterSession(StringSE callerName, SetSE<StringSE> groups)
HttpMessageContext
HttpAuthenticationMechanism
は、各リクエストの開始時にランタイムで手動で再認証する必要があります。HttpMessageContext
の setRegisterSession
callerName
- 認証を記憶する必要がある発信者名 groups
- 認証を記憶する必要があるグループ。public void cleanClientSubject()
HttpMessageContext
このサブジェクトのクリーニングは、ServerAuthModule#cleanSubject メソッドの Jakarta Authentication のサーブレットコンテナープロファイルと、この仕様で定義されている HttpAuthenticationMechanism.cleanSubject(HttpServletRequest, HttpServletResponse, HttpMessageContext)
メソッドで定義されているとおりに実行されます。
HttpMessageContext
の cleanClientSubject
public AuthenticationParameters getAuthParameters()
HttpMessageContext
HttpMessageContext
の getAuthParameters
public CallbackHandlerSE getHandler()
HttpMessageContext
HttpMessageContext
の作成時にランタイムが提供し、このコンテキストが認証の詳細をランタイムに伝達するために使用する低レベルの Jakarta Authentication ハンドラーを返します。メモ : これは低レベルのオブジェクトであり、ほとんどの高レベルのコードで直接使用する必要はありません。
HttpMessageContext
の getHandler
public MessageInfo getMessageInfo()
HttpMessageContext
メモ : これは低レベルのオブジェクトであり、ほとんどの高レベルのコードで直接使用する必要はありません。
HttpMessageContext
の getMessageInfo
public SubjectSE getClientSubject()
HttpMessageContext
メモ : これは低レベルのオブジェクトであり、ほとんどの高レベルのコードで直接使用する必要はありません。
HttpMessageContext
の getClientSubject
public HttpServletRequest getRequest()
HttpMessageContext
HttpMessageContext
の getRequest
public void setRequest(HttpServletRequest request)
HttpMessageContext
HttpMessageContext
の setRequest
request
- 設定するリクエストオブジェクト public HttpMessageContext withRequest(HttpServletRequest request)
HttpMessageContext
HttpMessageContext
の withRequest
request
- 設定されるリクエストオブジェクト。public HttpServletResponse getResponse()
HttpMessageContext
HttpMessageContext
の getResponse
public void setResponse(HttpServletResponse response)
HttpMessageContext
HttpMessageContext
の setResponse
response
- 設定するレスポンスオブジェクト。public AuthenticationStatus redirect(StringSE location)
HttpMessageContext
便宜上、このメソッドは SEND_CONTINUE を返すため、このメソッドは HttpAuthenticationMechanism
からの 1 つの流れるような return ステートメントで使用できます。
HttpMessageContext
の redirect
location
- リダイレクトする場所 AuthenticationStatus.SEND_CONTINUE
HttpServletResponse.sendRedirect(String)
public AuthenticationStatus forward(StringSE path)
HttpMessageContext
便宜上、このメソッドは SEND_CONTINUE を返すため、このメソッドは HttpAuthenticationMechanism
からの 1 つの流れるような return ステートメントで使用できます。
HttpMessageContext
の forward
path
- リソースへのパス名を指定する文字列。AuthenticationStatus.SEND_CONTINUE
RequestDispatcher.forward(jakarta.servlet.ServletRequest, jakarta.servlet.ServletResponse)
public AuthenticationStatus responseUnauthorized()
HttpMessageContext
便宜上、このメソッドは SEND_FAILURE を返すため、このメソッドは HttpAuthenticationMechanism
からの 1 つの流れるような return ステートメントで使用できます。
HttpMessageContext
の responseUnauthorized
AuthenticationStatus.SEND_FAILURE
public AuthenticationStatus responseNotFound()
HttpMessageContext
便宜上、このメソッドは SEND_FAILURE を返すため、このメソッドは HttpAuthenticationMechanism
からの 1 つの流れるような return ステートメントで使用できます。
HttpMessageContext
の responseNotFound
AuthenticationStatus.SEND_FAILURE
public AuthenticationStatus notifyContainerAboutLogin(StringSE username, SetSE<StringSE> roles)
HttpMessageContext
SecurityContext.isCallerInRole(String)
などで使用するためにアプリケーションで使用できるようにするために、指定された呼び出し元の名前とグループを登録するようにコンテナーに要求します。この呼び出しが返された後、認証された ID はすぐにはアクティブにならないことに注意してください。これは、この呼び出しが行われる認証メカニズムが制御をコンテナーに戻した後(実行時)にのみ発生します(エラーが発生しない場合)。
便宜上、このメソッドは SUCCESS を返すため、このメソッドは HttpAuthenticationMechanism
からの 1 つの流れるような return ステートメントで使用できます。
HttpMessageContext
の notifyContainerAboutLogin
username
- 発信者プリンシパルとなる発信者名 roles
- 発信者プリンシパルに関連付けられているグループ AuthenticationStatus.SUCCESS
public AuthenticationStatus notifyContainerAboutLogin(PrincipalSE principal, SetSE<StringSE> roles)
HttpMessageContext
SecurityContext.isCallerInRole(String)
などで使用するためにアプリケーションで使用できるようにするために、指定された呼び出し元のプリンシパルとグループを登録するようにコンテナーに要求します。この呼び出しにより、コンテナーは、呼び出し元の ID を表す 2 つの呼び出し元プリンシパルを確立する可能性があることに注意してください。ここでは、プリンシパルパラメーターとして提供されるプリンシパルと、コンテナーの呼び出し元 ID の表現として使用される 2 番目のプリンシパルです。2 番目のプリンシパルは、コンテナーが呼び出し元を表すために異なるプリンシパル型を使用する場合にのみ追加されます。型が同じである場合、1 つのプリンシパルのみが追加されます。
2 番目のプリンシパルが追加された場合、Principal.getName()
SE によって返される値は両方のプリンシパルで同じになります。
2 つのプリンシパルが追加されると、コンテナーの呼び出し元プリンシパルが SecurityContext.getCallerPrincipal()
から返され、ここでパラメーターとして指定されたプリンシパルは SecurityContext.getPrincipalsByType(Class)
を使用して取得できます。1 つだけ追加すると、SecurityContext.getCallerPrincipal()
によって返されます。
この呼び出しが返された後、認証された ID はすぐにはアクティブにならないことに注意してください。これは、この呼び出しが行われる認証メカニズムが制御をコンテナーに戻した後(実行時)にのみ発生します(エラーが発生しない場合)。
便宜上、このメソッドは SUCCESS を返すため、このメソッドは HttpAuthenticationMechanism
からの 1 つの流れるような return ステートメントで使用できます。
HttpMessageContext
の notifyContainerAboutLogin
principal
- 発信者プリンシパルになるプリンシパル roles
- 発信者プリンシパルに関連付けられているグループ AuthenticationStatus.SUCCESS
public AuthenticationStatus notifyContainerAboutLogin(CredentialValidationResult result)
HttpMessageContext
CredentialValidationResult
結果をコンテナーに直接渡すことを目的とした便利なメソッド。 指定された CredentialValidationResult.getStatus()
の結果が CredentialValidationResult.Status.VALID
に等しい場合、CallerPrincipal
とグループは CredentialValidationResult
から取得され、HttpMessageContext.notifyContainerAboutLogin(Principal, Set)
に渡されます。
指定された CredentialValidationResult.getStatus()
の結果が CredentialValidationResult.Status.VALID
と等しくない場合、失敗の結果が返されます。
HttpMessageContext
の notifyContainerAboutLogin
result
- ステータスがインスペクションされ、プリンシパルとグループが取得される CredentialValidationResult。CredentialValidationResult.getStatus()
が CredentialValidationResult.Status.VALID
と等しい場合は AuthenticationStatus.SUCCESS
、それ以外の場合は AuthenticationStatus.SEND_FAILURE
public AuthenticationStatus doNothing()
HttpMessageContext
何もしない場合、Jakarta Security 認証メカニズムは、戻り値を介してこれを明示的に示す必要があります。
便宜上、このメソッドは NOT_DONE を返すため、このメソッドは HttpAuthenticationMechanism
からの 1 つの流れるような return ステートメントで使用できます。
HttpMessageContext
の doNothing
AuthenticationStatus.NOT_DONE
public PrincipalSE getCallerPrincipal()
HttpMessageContext
HttpMessageContext
の getCallerPrincipal
public SetSE<StringSE> getGroups()
HttpMessageContext
HttpMessageContext
の getGroups
Copyright © 2018,2020 Eclipse Foundation.
Use is subject to license terms.