3. GCNCasProxyAuthenticationServletFilter

3.1. Introduction

The GCNCasProxyAuthenticationServletFilter class is a filter that will examine incomming requests and decide whether an authentication request should be send to Gentics Content.Node.

3.2. Details

The filter will modify the request and response headers in case that the request headers do not contain Gentics Content.Node authentication information. A correct sid and session secret will be added to the request and a set-cookie parameter will be set to the response headers. The Gentics Content.Node session information will be stored in the HttpSession of the portal user. The session id is stored with key 'content.node.session.id' and the session secret is stored with the secret 'content.node.session.secret'. A reauthentication will be performed when the filter detects that the request was not sucuessful.

This filter will perform a cas proxy request. Therefore it is mandatory to have a working cas proxy setup.

3.3. Parameters

Table 7.2.  Portlet parameters for GCNCasProxyAuthenticationServletFilter

NameTypeDefaultDescription
filterURLAcceptRegexString-Defines a regex which can be used to tell the filter which urls it should process. Example: '^(/GCN/.*)$'
gcnRestLoginPathString/CNPortletapp/rest/auth/loginPath to the gcn rest api login action (Optional)
gcnBackendBasePathString-Gentics Content.Node backend path. Example: http://cms.my-gcn-server/
casServerUrlPrefixString-Prefix for the cas server. Example: https://mycas/cas-server

3.4. Example configuration

Configuration for cas proxy enabled portal server that uses the proxy servlet.

Example 7.1. Syntax Example configuration

	<context-param>
		<param-name>contextPath</param-name>
		<param-value>/GCN5_Portal</param-value>
	</context-param>
	<context-param>
		<param-name>gcnBackendBasePath</param-name>
		<param-value>http://cms.my-gcn-server/</param-value>
	</context-param>
	<context-param>
		<param-name>casServerLoginUrl</param-name>
		<param-value>https://mycas/cas-server/login</param-value>
	</context-param>
	<context-param>
		<param-name>casServerUrlPrefix</param-name>
		<param-value>https://mycas/cas-server</param-value>
	</context-param>
	<context-param>
		<param-name>serverName</param-name>
		<param-value>https://myfrontend</param-value>
	</context-param>

	<servlet>
		<servlet-name>ProxyServlet</servlet-name>
		<servlet-class>com.gentics.portalnode.proxy.GCNProxyServlet</servlet-class>
	</servlet>
	<servlet-mapping>
		<servlet-name>ProxyServlet</servlet-name>
		<url-pattern>/GCN/*</url-pattern>
	</servlet-mapping>

	<filter>
		<filter-name>CAS Workaround Ticket Parameter Fix</filter-name>
		<filter-class>com.gentics.portalnode.auth.gcn.cas.CASParameterWorkaroundServletFilter</filter-class>
		<init-param>
			<param-name>handledParameterNames</param-name>
			<param-value>sid,ticket</param-value>
		</init-param>
	</filter>
	<filter-mapping>
		<filter-name>CAS Workaround Ticket Parameter Fix</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>

	<!-- SSO listener -->
	<!-- 1. Validation filter to validate cas tickets -->
	<filter>
		<filter-name>CAS Ticket Validation Filter</filter-name>
		<filter-class>org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter</filter-class>
		<init-param>
			<param-name>acceptAnyProxy</param-name>
			<param-value>true</param-value>
		</init-param>
		<!-- The service behind this url will watch out for cas calls -->
		<init-param>
			<param-name>proxyReceptorUrl</param-name>
			<param-value>/GCN5_Portal/receptor</param-value>
		</init-param>
		<!-- pgtUrl for proxyValidate -->
		<init-param>
			<param-name>proxyCallbackUrl</param-name>
			<param-value>https://myfrontend/GCN5_Portal/receptor</param-value>
		</init-param>

	</filter>
	<filter-mapping>
		<filter-name>CAS Ticket Validation Filter</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>


	<!-- 2. AuthenticationFilter -->
	<filter>
		<filter-name>CAS Authentication Filter</filter-name>
		<filter-class>org.jasig.cas.client.authentication.AuthenticationFilter</filter-class>
		<init-param>
			<param-name>gateway</param-name>
			<param-value>false</param-value>
		</init-param>
	</filter>
	<filter-mapping>
		<filter-name>CAS Authentication Filter</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>

	<filter>
		<filter-name>CAS HttpServletRequest Wrapper Filter</filter-name>
		<filter-class>org.jasig.cas.client.util.HttpServletRequestWrapperFilter</filter-class>
	</filter>
	<filter-mapping>
		<filter-name>CAS HttpServletRequest Wrapper Filter</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>
	<filter>
		<filter-name>CAS Assertion Thread Local Filter</filter-name>
		<filter-class>org.jasig.cas.client.util.AssertionThreadLocalFilter</filter-class>
	</filter>
	<filter-mapping>
		<filter-name>CAS Assertion Thread Local Filter</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>

	<!-- The GCN Authenticationfilter -->
	<filter>
		<filter-name>CAS - GCN Authentication Filter</filter-name>
		<filter-class>com.gentics.portalnode.auth.gcn.cas.GCNCasProxyAuthenticationServletFilter</filter-class>
		<init-param>
			<param-name>filterURLAcceptRegex</param-name>
			<param-value>^(/GCN/.*)$</param-value>
		</init-param>
	</filter>
	<filter-mapping>
		<filter-name>CAS - GCN Authentication Filter</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>
	<!-- end SSO Filters -->

Table 7.3. Settings Example configuration

NameTypeDefaultDescription
No Settings.