クラス SecurityContextHolderAwareRequestWrapper

  • 実装されたすべてのインターフェース:
    javax.servlet.http.HttpServletRequestjavax.servlet.ServletRequest

    public class SecurityContextHolderAwareRequestWrapper
    extends javax.servlet.http.HttpServletRequestWrapper
    Spring Security-aware HttpServletRequestWrapperSecurityContext -defined Authentication オブジェクトを使用してサーブレット API のセキュリティメソッドを実装します。
    関連事項:
    SecurityContextHolderAwareRequestFilter
    • フィールドサマリー

      • インターフェース javax.servlet.http.HttpServletRequest から継承されたフィールド

        BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
    • メソッドのサマリー

      すべてのメソッド   インスタンスメソッド   具象メソッド  
      修飾子と型 メソッド 説明
      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 - 元の HttpServletRequest
        trustResolver - 使用する AuthenticationTrustResolver。null にはできません。
        rolePrefix - isUserInRole(String) に追加する接頭辞。接頭辞がない場合は null。
    • メソッドの詳細

      • getRemoteUser

        public java.lang.String getRemoteUser()
        SecurityContextHolder から取得したプリンシパルの名前を返します。String ベースと UserDetails ベースの両方のプリンシパルを適切に処理します。
        次で指定:
        インターフェース javax.servlet.http.HttpServletRequestgetRemoteUser 
        オーバーライド:
        クラス javax.servlet.http.HttpServletRequestWrappergetRemoteUser 
        戻り値:
        ユーザー名または使用できない場合は null 
      • getUserPrincipal

        public java.security.Principal getUserPrincipal()
        Authentication (Principal のサブクラス)、または使用できない場合は null を返します。
        次で指定:
        インターフェース javax.servlet.http.HttpServletRequestgetUserPrincipal 
        オーバーライド:
        クラス javax.servlet.http.HttpServletRequestWrappergetUserPrincipal 
        戻り値:
        Authentication または null
      • isUserInRole

        public boolean isUserInRole​(java.lang.String role)
        正確に一致する GrantedAuthority.getAuthority() を簡単に検索します。

        SecurityContextHolder に nullprincipal および / または GrantedAuthority[] オブジェクトを含む Authentication が含まれている場合、常に false を返します。

        次で指定:
        インターフェース javax.servlet.http.HttpServletRequestisUserInRole 
        オーバーライド:
        クラス javax.servlet.http.HttpServletRequestWrapperisUserInRole 
        パラメーター:
        role - チェックする GrantedAuthorityString 表現
        戻り値:
        正確な(大文字と小文字を区別する)一致する付与された権限が見つかった場合は true、それ以外の場合は false 
      • toString

        public java.lang.String toString()
        オーバーライド:
        クラス java.lang.ObjecttoString