diff --git a/README.md b/README.md index 48fdc21..a5bc844 100644 --- a/README.md +++ b/README.md @@ -976,6 +976,70 @@ The following example shows how to configure a Context for dynamic role data pro ``` + +## Jetty Integration +Since version 3.4.2, the Java CAS Client supports Jetty container integration via the following module: + +```xml + + org.jasig.cas.client + cas-client-integration-jetty + ${cas-client.version} + +``` + +Both programmatic (embedded) and context configuration are supported. + +### Jetty Embedded Configuration +``` +# CAS configuration parameters +String hostName = "app.example.com"; +String casServerBaseUrl = "cas.example.com/cas"; +String casRoleAttribute = "memberOf"; +boolean casRenew = false; +int casTolerance = 5000; + +# Jetty wiring +WebAppContext context = new WebAppContext("/path/to/context", "contextPath"); +context.setTempDirectory("/tmp/jetty/work")); +context.setInitParameter("org.eclipse.jetty.servlet.Default.dirAllowed", "false"); +SessionCookieConfig config = context.getSessionHandler().getSessionManager().getSessionCookieConfig(); +config.setHttpOnly(true); +config.setSecure(true); +Saml11TicketValidator validator = new Saml11TicketValidator(casServerBaseUrl); +validator.setRenew(casRenew); +validator.setTolerance(casTolerance); +CasAuthenticator authenticator = new CasAuthenticator(); +authenticator.setRoleAttribute(casRoleAttribute); +authenticator.setServerNames(hostName); +authenticator.setTicketValidator(validator); +context.getSecurityHandler().setAuthenticator(authenticator); +``` + +### Jetty Context Configuration +```xml + + + + + / + /webapps/yourapp + + + + app.example.com + + + https://cas.example.com/cas + + + + + + + +``` + ## Atlassian Integration The clien includes Atlassian Confluence and JIRA support. Support is enabled by a custom CAS authenticator that extends the default authenticators.