public class CASFilter extends Object implements Filter
Protects web-accessible resources with CAS.
The following filter initialization parameters are declared in
web.xml
:
edu.yale.its.tp.cas.client.filter.loginUrl
: URL to
login page on CAS server. (Required)edu.yale.its.tp.cas.client.filter.validateUrl
: URL
to validation URL on CAS server. (Required)edu.yale.its.tp.cas.client.filter.serviceUrl
: URL
of this service. (Required if serverName
is not
specified)edu.yale.its.tp.cas.client.filter.serverName
: full
hostname with port number (e.g. www.foo.com:8080
).
Port number isn't required if it is standard (80 for HTTP, 443 for
HTTPS). (Required if serviceUrl
is not specified)edu.yale.its.tp.cas.client.filter.authorizedProxy
:
whitespace-delimited list of valid proxies through which authentication
may have proceeded. One one proxy must match. (Optional. If nothing
is specified, the filter will only accept service tickets not
proxy tickets.)edu.yale.its.tp.cas.client.filter.renew
: value of
CAS "renew" parameter. Bypasses single sign-on and requires user
to provide CAS with his/her credentials again. (Optional. If nothing
is specified, this defaults to false.)edu.yale.its.tp.cas.client.filter.wrapRequest
:
wrap the HttpServletRequest
object, overriding the
getRemoteUser()
method. When set to "true",
request.getRemoteUser()
will return the username of the
currently logged-in CAS user. (Optional. If nothing is specified,
this defaults to false.)The logged-in username is set in the session attribute defined by
the value of CAS_FILTER_USER
and may be accessed from within
your application either by setting wrapRequest
and calling
request.getRemoteUser()
, or by calling
session.getAttribute(CASFilter.CAS_FILTER_USER)
.
Modifier and Type | Field and Description |
---|---|
static String |
CAS_FILTER_USER
Session attribute in which the username is stored
|
Constructor and Description |
---|
CASFilter() |
Modifier and Type | Method and Description |
---|---|
void |
destroy() |
void |
doFilter(ServletRequest request,
ServletResponse response,
FilterChain fc) |
void |
init(FilterConfig config) |
public static final String CAS_FILTER_USER
public void init(FilterConfig config) throws ServletException
init
in interface Filter
ServletException
public void doFilter(ServletRequest request, ServletResponse response, FilterChain fc) throws ServletException, IOException
doFilter
in interface Filter
ServletException
IOException
Copyright © 2013 Nuxeo SA. All Rights Reserved.