クラス SecurityContextHolderAwareRequestWrapper
- java.lang.Object
-
- javax.servlet.ServletRequestWrapper
-
- javax.servlet.http.HttpServletRequestWrapper
-
- org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestWrapper
- 実装済みのインターフェース一覧:
javax.servlet.http.HttpServletRequest,javax.servlet.ServletRequest
public class SecurityContextHolderAwareRequestWrapper extends javax.servlet.http.HttpServletRequestWrapperSpring Security-awareHttpServletRequestWrapper。SecurityContext-definedAuthenticationオブジェクトを使用してサーブレット API のセキュリティメソッドを実装します。getUserPrincipal()isUserInRole(String)HttpServletRequestWrapper.getRemoteUser().
コンストラクター概要
コンストラクター コンストラクター 説明 SecurityContextHolderAwareRequestWrapper(javax.servlet.http.HttpServletRequest request, java.lang.String rolePrefix)AuthenticationTrustResolverImplで新しいインスタンスを作成します。SecurityContextHolderAwareRequestWrapper(javax.servlet.http.HttpServletRequest request, AuthenticationTrustResolver trustResolver, java.lang.String rolePrefix)新しいインスタンスを作成します
方法の概要
すべてのメソッド インスタンスメソッド 具象メソッド 修飾子と型 メソッド 説明 java.lang.StringgetRemoteUser()SecurityContextHolderから取得したプリンシパルの名前を返します。java.security.PrincipalgetUserPrincipal()Authentication(Principalのサブクラス)、または使用できない場合はnullを返します。booleanisUserInRole(java.lang.String role)正確に一致するGrantedAuthority.getAuthority()を簡単に検索します。java.lang.StringtoString()クラス javax.servlet.http.HttpServletRequestWrapper から継承されたメソッド
authenticate, changeSessionId, getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getHttpServletMapping, getIntHeader, getMethod, getPart, getParts, getPathInfo, getPathTranslated, getQueryString, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, getSession, getTrailerFields, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isTrailerFieldsReady, login, logout, newPushBuilder, upgrade
クラス javax.servlet.ServletRequestWrapper から継承されたメソッド
getAsyncContext, getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequest, getRequestDispatcher, getScheme, getServerName, getServerPort, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, isWrapperFor, isWrapperFor, removeAttribute, setAttribute, setCharacterEncoding, setRequest, startAsync, startAsync
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
インターフェース javax.servlet.ServletRequest から継承されたメソッド
getAsyncContext, getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, removeAttribute, setAttribute, setCharacterEncoding, startAsync, startAsync
コンストラクターの詳細
SecurityContextHolderAwareRequestWrapper
public SecurityContextHolderAwareRequestWrapper(javax.servlet.http.HttpServletRequest request, java.lang.String rolePrefix)AuthenticationTrustResolverImplで新しいインスタンスを作成します。- パラメーター:
request-rolePrefix-
SecurityContextHolderAwareRequestWrapper
public SecurityContextHolderAwareRequestWrapper(javax.servlet.http.HttpServletRequest request, AuthenticationTrustResolver trustResolver, java.lang.String rolePrefix)新しいインスタンスを作成します- パラメーター:
request- 元のHttpServletRequesttrustResolver- 使用するAuthenticationTrustResolver。null にはできません。rolePrefix-isUserInRole(String)に追加する接頭辞。接頭辞がない場合は null。
メソッドの詳細
getRemoteUser
public java.lang.String getRemoteUser()
SecurityContextHolderから取得したプリンシパルの名前を返します。StringベースとUserDetailsベースの両方のプリンシパルを適切に処理します。- 次で指定:
- インターフェース
javax.servlet.http.HttpServletRequest内のgetRemoteUser - オーバーライド:
- クラス
javax.servlet.http.HttpServletRequestWrapperのgetRemoteUser - 戻り値:
- ユーザー名または使用できない場合は
null
getUserPrincipal
public java.security.Principal getUserPrincipal()
Authentication(Principalのサブクラス)、または使用できない場合はnullを返します。- 次で指定:
- インターフェース
javax.servlet.http.HttpServletRequest内のgetUserPrincipal - オーバーライド:
- クラス
javax.servlet.http.HttpServletRequestWrapperのgetUserPrincipal - 戻り値:
Authenticationまたはnull
isUserInRole
public boolean isUserInRole(java.lang.String role)
正確に一致するGrantedAuthority.getAuthority()を簡単に検索します。SecurityContextHolderにnullprincipalおよび / またはGrantedAuthority[]オブジェクトを含むAuthenticationが含まれている場合、常にfalseを返します。- 次で指定:
- インターフェース
javax.servlet.http.HttpServletRequest内のisUserInRole - オーバーライド:
- クラス
javax.servlet.http.HttpServletRequestWrapperのisUserInRole - パラメーター:
role- チェックするGrantedAuthorityString表現- 戻り値:
- 正確な(大文字と小文字を区別する)一致する付与された権限が見つかった場合は
true、それ以外の場合はfalse
toString
public java.lang.String toString()
- オーバーライド:
- クラス
java.lang.ObjectのtoString