public class ShiroHttpServletRequest extends HttpServletRequestWrapper
ShiroHttpServletRequest wraps the Servlet container's original
ServletRequest instance, but ensures that all
HttpServletRequest invocations that require Shiro's support (
getRemoteUser,
getSession, etc) can be executed first by Shiro as necessary before allowing the underlying Servlet container instance's method to be invoked.
| Modifier and Type | Field and Description |
|---|---|
static String |
COOKIE_SESSION_ID_SOURCE
|
protected boolean |
httpSessions
|
static String |
IDENTITY_REMOVED_KEY
|
static String |
REFERENCED_SESSION_ID
|
static String |
REFERENCED_SESSION_ID_IS_VALID
|
static String |
REFERENCED_SESSION_ID_SOURCE
|
static String |
REFERENCED_SESSION_IS_NEW
|
protected ServletContext |
servletContext
|
protected HttpSession |
session
|
static String |
URL_SESSION_ID_SOURCE
|
| Constructor and Description |
|---|
ShiroHttpServletRequest(HttpServletRequest wrapped, ServletContext servletContext, boolean httpSessions)
|
| Modifier and Type | Method and Description |
|---|---|
String |
getRemoteUser()
|
String |
getRequestedSessionId()
|
HttpSession |
getSession()
|
HttpSession |
getSession(boolean create)
|
protected Subject |
getSubject()
|
protected Object |
getSubjectPrincipal()
|
Principal |
getUserPrincipal()
|
boolean |
isHttpSessions()
|
boolean |
isRequestedSessionIdFromCookie()
|
boolean |
isRequestedSessionIdFromUrl()
|
boolean |
isRequestedSessionIdFromURL()
|
boolean |
isRequestedSessionIdValid()
|
boolean |
isUserInRole(String
|
public static final StringCOOKIE_SESSION_ID_SOURCE
public static final StringURL_SESSION_ID_SOURCE
public static final StringREFERENCED_SESSION_ID
public static final StringREFERENCED_SESSION_ID_IS_VALID
public static final StringREFERENCED_SESSION_IS_NEW
public static final StringREFERENCED_SESSION_ID_SOURCE
public static final StringIDENTITY_REMOVED_KEY
protected ServletContext servletContext
protected HttpSession session
protected boolean httpSessions
public ShiroHttpServletRequest(HttpServletRequest wrapped,
ServletContext servletContext,
boolean httpSessions)public boolean isHttpSessions()
public StringgetRemoteUser()
protected SubjectgetSubject()
protected ObjectgetSubjectPrincipal()
public boolean isUserInRole(Strings)
public PrincipalgetUserPrincipal()
public StringgetRequestedSessionId()
public HttpSession getSession(boolean create)
public HttpSession getSession()
public boolean isRequestedSessionIdValid()
public boolean isRequestedSessionIdFromCookie()
public boolean isRequestedSessionIdFromURL()
public boolean isRequestedSessionIdFromUrl()