What is itThe YaleCasFilteredContext is an IYaleCasContext implementation which consumes the results of the CASValidateFilter having performed the actual authentication. How does it work?Maybe you would like to view the source code. How do I configure it?You'll need to configure the security context in your security.properties file and configure the CASValidateFilter in your web.xml. Setting the security.propertiesNote: this example is for using CAS authentication exclusively. A very common configuration is to use CAS alongside another authentication provider, such as local Simple authentication (MD5 passwords). If you're just getting things set up, you may wish to start with this simpler configuration and then add the complexity of the UnionSecurityContext. You need to set the root security context factory to be the YaleCasFilteredContextFactory: root=edu.yale.its.tp.portal.security.YaleCasFilteredContextFactory You need to set the credential token "ticket": # Answers what tokens are examined in the request for each context during authentication. # A subcontext only needs to set it's tokens if it differs from those of the root context. #principalToken.root=userName #credentialToken.root=password credentialToken.root=ticket Mapping the filtersIn your web.xml, you need to map and configure the CASValidateFilter and a helper filter which provides a static cache so that the YaleCasFilteredContext can obtain the [CAS:CASReceipt] bearing the results of the authentication.
<filter> <filter-name>CAS Validate Filter</filter-name> <filter-class>edu.yale.its.tp.cas.client.filter.CASValidateFilter</filter-class> <init-param> <param-name>edu.yale.its.tp.cas.client.filter.validateUrl</param-name> <param-value>https://secure.its.yale.edu/cas/serviceValidate</param-value> </init-param> <init-param> <param-name>edu.yale.its.tp.cas.client.filter.serverName</param-name> <param-value>hkg2.cis.yale.edu:8080</param-value> </init-param> <init-param> <param-name>edu.yale.its.tp.cas.client.filter.proxyCallbackUrl</param-name> <param-value>https://hkg2.cis.yale.edu/uPortal/CasProxyServlet</param-value> </init-param> </filter> <filter> <filter-name>CAS Receipt Cacher</filter-name> <filter-class>edu.yale.its.tp.cas.client.filter.StaticCasReceiptCacherFilter</filter-class> </filter> <filter-mapping> <filter-name>CAS Validate Filter</filter-name> <url-pattern>/Login</url-pattern> </filter-mapping> <filter-mapping> <filter-name>CAS Receipt Cacher</filter-name> <url-pattern>/Login</url-pattern> </filter-mapping> Where can I get it?The YaleCasFilteredContext is part of the Yale uPortal CAS security provider package, available here. Proxying authenticationThe above instructions should get you to the point where users can authenticate to your uPortal itself using CAS. A killer feature for portals that CAS offers beyond this initial authentication is proxy authentication. In this section we describe the additional configuration you need to make to turn on proxy authentication. We highly recommend that you first verify that you are able to CAS authenticate to your uPortal istself before tackling the additional complexities of proxy authentication. Receiving proxy ticketsYou'll need to map the ProxyTicketReceptor servlet in your web.xml. This servlet must be available via https: Mapping the ProxyTicketReceptor in web.xml <servlet>
<servlet-name>CasProxyServlet</servlet-name>
<servlet-class>edu.yale.its.tp.cas.proxy.ProxyTicketReceptor</servlet-class>
<load-on-startup>4</load-on-startup>
</servlet>
...
<servlet-mapping>
<servlet-name>CasProxyServlet</servlet-name>
<url-pattern>/CasProxyServlet</url-pattern>
</servlet-mapping>
Asking for proxy ticketsHaving mapped ProxyTicketReceptor, you're prepared to receive proxy tickets if the CAS server would send them to you. But you also need to configure the CASValidateFilter to ask for them. You need to add the filter init-param "edu.yale.its.tp.cas.client.filter.proxyCallbackUrl" to your CASValidateFilter configuration. Configuring CASValidateFilter to request proxy granting tickets <filter> <filter-name>CAS Validate Filter</filter-name> <filter-class>edu.yale.its.tp.cas.client.filter.CASValidateFilter</filter-class> <init-param> <param-name>edu.yale.its.tp.cas.client.filter.validateUrl</param-name> <param-value>https://secure.its.yale.edu/cas/serviceValidate</param-value> </init-param> <init-param> <param-name>edu.yale.its.tp.cas.client.filter.serverName</param-name> <param-value>hkg2.cis.yale.edu:8080</param-value> </init-param> <init-param> <param-name>edu.yale.its.tp.cas.client.filter.proxyCallbackUrl</param-name> <param-value>https://hkg2.cis.yale.edu/uPortal/CasProxyServlet</param-value> </init-param> </filter>
Obtaining and using ProxyTickets in your IChannel implementationsYour IChannels obtain and use proxy tickets through the [LocalConnectionContext] abstraction, as implemented by a CasConnectionContext instance. |
