public final class SSOClientFilter extends HandleFilter implements javax.servlet.Filter
It is generally appropriate to map this filter to run for all your application requests, i.e. mapped to "/*". It will know not to run when your ShireServlet or LogoutServlet are requested, as long as these are specified correctly in your sso-config.xml file.
getUserFromRequest(HttpServletRequest) can be used to conveniently
fetch the current User object from the appropriate request attribute.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ACTUAL_USER_KEY |
static java.lang.String |
GLOBAL_LOGIN_COOKIE_NAME |
static java.lang.String |
PROXY_TICKET_COOKIE_NAME |
static java.lang.String |
USER_KEY |
| Constructor and Description |
|---|
SSOClientFilter() |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy() |
void |
doFilter(javax.servlet.ServletRequest servletRequest,
javax.servlet.ServletResponse servletResponse,
javax.servlet.FilterChain filterChain) |
uk.ac.warwick.sso.client.AttributeAuthorityResponseFetcher |
getAaFetcher() |
uk.ac.warwick.sso.client.SSOConfiguration |
getConfig() |
java.lang.String |
getConfigSuffix() |
uk.ac.warwick.sso.client.SSOHandler |
getHandler() |
static uk.ac.warwick.userlookup.User |
getUserFromRequest(javax.servlet.http.HttpServletRequest req)
Will always return an AnonymousUser if there is either no config or no user in the request
|
static java.lang.String |
getUserKey() |
uk.ac.warwick.userlookup.UserLookupInterface |
getUserLookup() |
void |
init(javax.servlet.FilterConfig ctx) |
void |
setAaFetcher(uk.ac.warwick.sso.client.AttributeAuthorityResponseFetcher aaFetcher) |
void |
setConfig(uk.ac.warwick.sso.client.SSOConfiguration _config) |
void |
setConfigLocation(java.lang.String path) |
void |
setConfigSuffix(java.lang.String configSuffix) |
void |
setDetectAnonymousOnCampusUsers(boolean detectAnonymousOnCampusUsers) |
void |
setHandler(uk.ac.warwick.sso.client.SSOClientHandler handler) |
void |
setRedirectToRefreshSession(boolean redirectToRefreshSession) |
void |
setUserLookup(uk.ac.warwick.userlookup.UserLookupInterface userLookup) |
filterWithHandlerpublic static final java.lang.String USER_KEY
public static final java.lang.String ACTUAL_USER_KEY
public static final java.lang.String GLOBAL_LOGIN_COOKIE_NAME
public static final java.lang.String PROXY_TICKET_COOKIE_NAME
public void init(javax.servlet.FilterConfig ctx)
throws javax.servlet.ServletException
init in interface javax.servlet.Filterjavax.servlet.ServletExceptionpublic void doFilter(javax.servlet.ServletRequest servletRequest,
javax.servlet.ServletResponse servletResponse,
javax.servlet.FilterChain filterChain)
throws java.io.IOException,
javax.servlet.ServletException
doFilter in interface javax.servlet.Filterjava.io.IOExceptionjavax.servlet.ServletExceptionpublic static uk.ac.warwick.userlookup.User getUserFromRequest(javax.servlet.http.HttpServletRequest req)
req - The incoming HTTP requestpublic static java.lang.String getUserKey()
public uk.ac.warwick.sso.client.SSOConfiguration getConfig()
getConfig in class HandleFilterpublic uk.ac.warwick.sso.client.SSOHandler getHandler()
getHandler in class HandleFilterpublic void destroy()
destroy in interface javax.servlet.Filterpublic void setDetectAnonymousOnCampusUsers(boolean detectAnonymousOnCampusUsers)
public void setConfigSuffix(java.lang.String configSuffix)
public void setHandler(uk.ac.warwick.sso.client.SSOClientHandler handler)
public void setUserLookup(uk.ac.warwick.userlookup.UserLookupInterface userLookup)
public uk.ac.warwick.sso.client.AttributeAuthorityResponseFetcher getAaFetcher()
public java.lang.String getConfigSuffix()
public uk.ac.warwick.userlookup.UserLookupInterface getUserLookup()
public void setRedirectToRefreshSession(boolean redirectToRefreshSession)
public void setConfigLocation(java.lang.String path)
public void setAaFetcher(uk.ac.warwick.sso.client.AttributeAuthorityResponseFetcher aaFetcher)
public void setConfig(uk.ac.warwick.sso.client.SSOConfiguration _config)