Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 50a6f6d9 authored by Guillaume Thomazon's avatar Guillaume Thomazon
Browse files

PROXY-186 : Use new CAS SSO

git-svn-id: https://scm.gforge.inria.fr/authscm/ycadoret/svn/gazelle/Maven/gazelle-proxy/trunk@61854 356b4b1a-1d2b-0410-8bf1-ffa24008f01e
parent 1b7c7ba6
No related branches found
No related tags found
No related merge requests found
Showing
with 160 additions and 514 deletions
......@@ -3,7 +3,7 @@
<parent>
<groupId>net.ihe.gazelle.proxy</groupId>
<artifactId>gazelle-proxy</artifactId>
<version>4.4.4-SNAPSHOT</version>
<version>4.5.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -4,7 +4,7 @@
<parent>
<groupId>net.ihe.gazelle.proxy</groupId>
<artifactId>gazelle-proxy</artifactId>
<version>4.4.4-SNAPSHOT</version>
<version>4.5.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>gazelle-proxy-ear</artifactId>
......
INSERT INTO app_configuration (id, variable, value) VALUES (nextval('app_configuration_id_seq'), 'cas_enable', 'true');
DELETE FROM app_configuration where variable='cas_url';
\ No newline at end of file
......@@ -3,7 +3,7 @@
<parent>
<groupId>net.ihe.gazelle.proxy</groupId>
<artifactId>gazelle-proxy</artifactId>
<version>4.4.4-SNAPSHOT</version>
<version>4.5.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
......@@ -71,11 +71,6 @@
<artifactId>jhighlight</artifactId>
<version>1.0.3</version>
</dependency>
<dependency>
<groupId>org.jasig.cas</groupId>
<artifactId>cas-client-core</artifactId>
<version>3.1.10.IHE.1</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
......@@ -134,7 +129,7 @@
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.4.1208.jre7</version>
<version>42.2.1.jre7</version>
</dependency>
<dependency>
<groupId>net.sf.opencsv</groupId>
......@@ -209,5 +204,10 @@
<artifactId>primefaces</artifactId>
<version>5.1</version>
</dependency>
<dependency>
<groupId>net.ihe.gazelle</groupId>
<artifactId>gazelle-cas-client</artifactId>
<version>${gazelle.cas.client.version}</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
......@@ -3,7 +3,7 @@
<parent>
<groupId>net.ihe.gazelle.proxy</groupId>
<artifactId>gazelle-proxy</artifactId>
<version>4.4.4-SNAPSHOT</version>
<version>4.5.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
......@@ -75,11 +75,6 @@
<artifactId>jhighlight</artifactId>
<version>1.0.3</version>
</dependency>
<dependency>
<groupId>org.jasig.cas</groupId>
<artifactId>cas-client-core</artifactId>
<version>3.1.10.IHE.1</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
......@@ -181,8 +176,13 @@
<dependency>
<groupId>net.ihe.gazelle</groupId>
<artifactId>gazelle-evsclient-connector</artifactId>
<version>1.1.13</version>
<version>1.1.17-SNAPSHOT</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>net.ihe.gazelle</groupId>
<artifactId>gazelle-cas-client</artifactId>
<version>${gazelle.cas.client.version}</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
......@@ -54,6 +54,7 @@ public class ApplicationConfigurationManager extends AbstractApplicationConfigur
private Integer maxProxyPort;
private String casUrl;
private String dcmDumpPath;
private Boolean casEnable;
public static ApplicationConfigurationManager instance() {
return (ApplicationConfigurationManager) Component.getInstance("applicationConfigurationManager");
......@@ -120,4 +121,17 @@ public class ApplicationConfigurationManager extends AbstractApplicationConfigur
return dcmDumpPath;
}
public boolean isCasEnable() {
if (casEnable == null) {
String booleanAsString = getApplicationProperty("application_works_without_cas");
if (booleanAsString == null) {
this.casEnable = false;
} else {
this.casEnable = Boolean.valueOf(booleanAsString);
}
}
return casEnable;
}
}
/*******************************************************************************
* Copyright 2011 IHE International (http://www.ihe.net)
* <p/>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p/>
* http://www.apache.org/licenses/LICENSE-2.0
* <p/>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/
package net.ihe.gazelle.proxy.authentication;
import net.ihe.gazelle.proxy.admin.gui.ApplicationConfigurationManager;
import org.jasig.cas.client.authentication.DefaultGatewayResolverImpl;
import org.jasig.cas.client.authentication.GatewayResolver;
import org.jasig.cas.client.util.AbstractCasFilter;
import org.jasig.cas.client.util.CommonUtils;
import org.jasig.cas.client.validation.Assertion;
import org.jboss.seam.contexts.Contexts;
import org.jboss.seam.contexts.Lifecycle;
import org.jboss.seam.log.LogProvider;
import org.jboss.seam.log.Logging;
import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
public class AuthenticationFilter extends AbstractCasFilter {
private static final LogProvider log = Logging.getLogProvider(AuthenticationFilter.class);
protected boolean isCASEnabled = false;
/**
* The URL to the CAS Server login.
*/
protected String casServerLoginUrl;
/**
* Whether to send the renew request or not.
*/
private boolean renew = false;
/**
* Whether to send the gateway request or not.
*/
private boolean gateway = false;
private GatewayResolver gatewayStorage = new DefaultGatewayResolverImpl();
public AuthenticationFilter() {
super();
isCASEnabled = false;
casServerLoginUrl = "-";
setIgnoreInitConfiguration(true);
setArtifactParameterName("ticket");
setServiceParameterName("service");
setEncodeServiceUrl(true);
setServerName(null);
setService("-");
}
@Override
protected void initInternal(FilterConfig filterconfig) throws ServletException {
super.initInternal(filterconfig);
}
@Override
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain)
throws IOException, ServletException {
reloadParameters(servletRequest);
if (isCASEnabled) {
doFilterCAS(servletRequest, servletResponse, filterChain);
} else {
filterChain.doFilter(servletRequest, servletResponse);
}
}
protected void reloadParameters(ServletRequest servletRequest) {
// Create a seam context if needed
boolean createContexts = !Contexts.isEventContextActive() && !Contexts.isApplicationContextActive();
if (createContexts) {
Lifecycle.beginCall();
}
setService(ApplicationConfigurationManager.instance().getApplicationUrl());
casServerLoginUrl = ApplicationConfigurationManager.instance().getCasUrl();
isCASEnabled = !ApplicationConfigurationManager.instance().isWorksWithoutCas();
if (createContexts) {
Lifecycle.endCall();
}
}
private void doFilterCAS(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain)
throws IOException, ServletException {
final HttpServletRequest request = (HttpServletRequest) servletRequest;
final HttpServletResponse response = (HttpServletResponse) servletResponse;
final HttpSession session = request.getSession(false);
final Assertion assertion = session != null ? (Assertion) session.getAttribute(CONST_CAS_ASSERTION) : null;
if (assertion != null) {
filterChain.doFilter(request, response);
return;
}
final String serviceUrl = constructServiceUrl(request, response);
final String ticket = CommonUtils.safeGetParameter(request, getArtifactParameterName());
final boolean wasGatewayed = gatewayStorage.hasGatewayedAlready(request, serviceUrl);
if (CommonUtils.isNotBlank(ticket) || wasGatewayed) {
filterChain.doFilter(request, response);
return;
}
final String modifiedServiceUrl;
log.debug("no ticket and no assertion found");
if (gateway) {
log.debug("setting gateway attribute in session");
modifiedServiceUrl = gatewayStorage.storeGatewayInformation(request, serviceUrl);
} else {
modifiedServiceUrl = serviceUrl;
}
if (log.isDebugEnabled()) {
log.debug("Constructed service url: " + modifiedServiceUrl);
}
final String urlToRedirectTo = CommonUtils
.constructRedirectUrl(this.casServerLoginUrl, getServiceParameterName(), modifiedServiceUrl, this.renew,
gateway);
if (log.isDebugEnabled()) {
log.debug("redirecting to \"" + urlToRedirectTo + "\"");
}
response.sendRedirect(urlToRedirectTo);
}
}
/*******************************************************************************
* Copyright 2011 IHE International (http://www.ihe.net)
* <p/>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p/>
* http://www.apache.org/licenses/LICENSE-2.0
* <p/>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/
package net.ihe.gazelle.proxy.authentication;
import net.ihe.gazelle.proxy.admin.gui.ApplicationConfigurationManager;
import org.jasig.cas.client.proxy.Cas20ProxyRetriever;
import org.jasig.cas.client.proxy.CleanUpTimerTask;
import org.jasig.cas.client.proxy.ProxyGrantingTicketStorage;
import org.jasig.cas.client.proxy.ProxyGrantingTicketStorageImpl;
import org.jasig.cas.client.util.AbstractCasFilter;
import org.jasig.cas.client.util.CommonUtils;
import org.jasig.cas.client.validation.Assertion;
import org.jasig.cas.client.validation.Cas20ServiceTicketValidator;
import org.jasig.cas.client.validation.TicketValidationException;
import org.jasig.cas.client.validation.TicketValidator;
import org.jboss.seam.contexts.Contexts;
import org.jboss.seam.contexts.Lifecycle;
import org.jboss.seam.log.LogProvider;
import org.jboss.seam.log.Logging;
import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.HashMap;
import java.util.Timer;
import java.util.TimerTask;
public class Cas20ProxyReceivingTicketValidationFilter extends AbstractCasFilter {
private static final LogProvider log = Logging.getLogProvider(Cas20ProxyReceivingTicketValidationFilter.class);
private static final int DEFAULT_MILLIS_BETWEEN_CLEANUPS = 60000;
protected boolean isCASEnabled = false;
protected String casServerLoginUrl;
private String proxyReceptorUrl;
private Timer timer;
private TimerTask timerTask;
private int millisBetweenCleanUps;
private ProxyGrantingTicketStorage proxyGrantingTicketStorage;
private TicketValidator ticketValidator;
private boolean redirectAfterValidation;
private boolean exceptionOnValidationFailure;
private boolean useSession;
public Cas20ProxyReceivingTicketValidationFilter() {
super();
isCASEnabled = false;
casServerLoginUrl = "http://tmp";
setIgnoreInitConfiguration(true);
setArtifactParameterName("ticket");
setServiceParameterName("service");
setEncodeServiceUrl(true);
setServerName(null);
setService("-");
setProxyReceptorUrl(null);
setProxyGrantingTicketStorage(new ProxyGrantingTicketStorageImpl());
setMillisBetweenCleanUps(DEFAULT_MILLIS_BETWEEN_CLEANUPS);
setExceptionOnValidationFailure(true);
setRedirectAfterValidation(true);
setUseSession(true);
setTicketValidator(createValidator());
}
protected Cas20ServiceTicketValidator createValidator() {
Cas20ServiceTicketValidator validator = new Cas20ServiceTicketValidator(casServerLoginUrl);
validator.setProxyCallbackUrl(null);
validator.setProxyGrantingTicketStorage(proxyGrantingTicketStorage);
validator.setProxyRetriever(new Cas20ProxyRetriever(casServerLoginUrl));
validator.setRenew(false);
validator.setCustomParameters(new HashMap<String, Object>());
return validator;
}
@Override
protected void initInternal(FilterConfig filterConfig) throws ServletException {
super.initInternal(filterConfig);
}
@Override
public void init() {
super.init();
CommonUtils.assertNotNull(proxyGrantingTicketStorage, "proxyGrantingTicketStorage cannot be null.");
if (timer == null) {
timer = new Timer(true);
}
if (timerTask == null) {
timerTask = new CleanUpTimerTask(proxyGrantingTicketStorage);
}
timer.schedule(timerTask, millisBetweenCleanUps, millisBetweenCleanUps);
CommonUtils.assertNotNull(ticketValidator, "ticketValidator cannot be null.");
}
@Override
public void destroy() {
super.destroy();
timer.cancel();
}
protected final boolean preFilter(ServletRequest servletRequest, ServletResponse servletResponse,
FilterChain filterChain) throws IOException, ServletException {
HttpServletRequest request = (HttpServletRequest) servletRequest;
HttpServletResponse response = (HttpServletResponse) servletResponse;
String requestUri = request.getRequestURI();
if (CommonUtils.isEmpty(proxyReceptorUrl) || !requestUri.endsWith(proxyReceptorUrl)) {
return true;
} else {
CommonUtils.readAndRespondToProxyReceptorRequest(request, response, proxyGrantingTicketStorage);
return false;
}
}
public final void setProxyReceptorUrl(String proxyReceptorUrl) {
this.proxyReceptorUrl = proxyReceptorUrl;
}
public void setProxyGrantingTicketStorage(ProxyGrantingTicketStorage storage) {
proxyGrantingTicketStorage = storage;
}
public void setTimer(Timer timer) {
this.timer = timer;
}
public void setTimerTask(TimerTask timerTask) {
this.timerTask = timerTask;
}
public void setMillisBetweenCleanUps(int millisBetweenCleanUps) {
this.millisBetweenCleanUps = millisBetweenCleanUps;
}
protected void onSuccessfulValidation(HttpServletRequest httpservletrequest,
HttpServletResponse httpservletresponse, Assertion assertion1) {
}
protected void onFailedValidation(HttpServletRequest httpservletrequest, HttpServletResponse httpservletresponse) {
}
protected void reloadParameters(ServletRequest servletRequest) {
// Create a seam context if needed
boolean createContexts = !Contexts.isEventContextActive() && !Contexts.isApplicationContextActive();
if (createContexts) {
Lifecycle.beginCall();
}
setService(ApplicationConfigurationManager.instance().getApplicationUrl());
casServerLoginUrl = ApplicationConfigurationManager.instance().getCasUrl();
if (!CommonUtils.isEmpty(casServerLoginUrl)) {
setTicketValidator(createValidator());
}
isCASEnabled = !ApplicationConfigurationManager.instance().isWorksWithoutCas();
if (createContexts) {
Lifecycle.endCall();
}
}
@Override
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain)
throws IOException, ServletException {
reloadParameters(servletRequest);
if (isCASEnabled) {
doFilterCAS(servletRequest, servletResponse, filterChain);
} else {
filterChain.doFilter(servletRequest, servletResponse);
}
}
public final void doFilterCAS(ServletRequest servletRequest, ServletResponse servletResponse,
FilterChain filterChain) throws IOException, ServletException {
if (!preFilter(servletRequest, servletResponse, filterChain)) {
return;
}
HttpServletRequest request = (HttpServletRequest) servletRequest;
HttpServletResponse response = (HttpServletResponse) servletResponse;
String ticket = CommonUtils.safeGetParameter(request, getArtifactParameterName());
if (CommonUtils.isNotBlank(ticket)) {
if (log.isDebugEnabled()) {
log.debug("Attempting to validate ticket: " + ticket);
}
try {
Assertion assertion = ticketValidator.validate(ticket, constructServiceUrl(request, response));
if (log.isDebugEnabled()) {
log.debug("Successfully authenticated user: " + assertion.getPrincipal().getName());
}
request.setAttribute("_const_cas_assertion_", assertion);
if (useSession) {
request.getSession().setAttribute("_const_cas_assertion_", assertion);
}
onSuccessfulValidation(request, response, assertion);
} catch (TicketValidationException e) {
response.setStatus(403);
log.warn(e, e);
onFailedValidation(request, response);
if (exceptionOnValidationFailure) {
throw new ServletException(e);
}
}
if (redirectAfterValidation) {
log.debug("Redirecting after successful ticket validation.");
response.sendRedirect(response.encodeRedirectURL(constructServiceUrl(request, response)));
return;
}
}
filterChain.doFilter(request, response);
}
public final void setTicketValidator(TicketValidator ticketValidator) {
this.ticketValidator = ticketValidator;
}
public final void setRedirectAfterValidation(boolean redirectAfterValidation) {
this.redirectAfterValidation = redirectAfterValidation;
}
public final void setExceptionOnValidationFailure(boolean exceptionOnValidationFailure) {
this.exceptionOnValidationFailure = exceptionOnValidationFailure;
}
public final void setUseSession(boolean useSession) {
this.useSession = useSession;
}
}
......@@ -3,7 +3,7 @@
<parent>
<groupId>net.ihe.gazelle.proxy</groupId>
<artifactId>gazelle-proxy</artifactId>
<version>4.4.4-SNAPSHOT</version>
<version>4.5.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -3,7 +3,7 @@
<parent>
<groupId>net.ihe.gazelle.proxy</groupId>
<artifactId>gazelle-proxy</artifactId>
<version>4.4.4-SNAPSHOT</version>
<version>4.5.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
......@@ -43,7 +43,7 @@
<dependency>
<groupId>net.ihe.gazelle</groupId>
<artifactId>gazelle-assets</artifactId>
<version>2.0.16</version>
<version>2.0.23</version>
<type>war</type>
</dependency>
<dependency>
......
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://jboss.org/schema/seam/pages"
xsi:schemaLocation="http://jboss.org/schema/seam/pages http://jboss.org/schema/seam/pages-2.3.xsd">
<page view-id="*">
<navigation>
<rule if-outcome="home">
<redirect view-id="/home.xhtml" />
</rule>
</navigation>
</page>
<exception class="org.jboss.seam.framework.EntityNotFoundException">
<redirect view-id="/error.xhtml">
<message severity="warn">Record not found</message>
</redirect>
</exception>
<exception class="javax.persistence.EntityNotFoundException">
<redirect view-id="/error.xhtml">
<message severity="warn">Record not found</message>
</redirect>
</exception>
<exception class="javax.persistence.EntityExistsException">
<redirect view-id="/error.xhtml">
<message severity="warn">Duplicate record</message>
</redirect>
</exception>
<exception class="javax.persistence.OptimisticLockException">
<end-conversation />
<redirect view-id="/error.xhtml">
<message severity="warn">Another user changed the same data, please try again</message>
</redirect>
</exception>
<exception class="org.jboss.seam.security.AuthorizationException">
<redirect view-id="/error.xhtml">
<message severity="error">You don't have permission to access this resource</message>
</redirect>
</exception>
<exception class="org.jboss.seam.security.NotLoggedInException">
<redirect view-id="/login.xhtml">
<message severity="warn">#{messages['org.jboss.seam.NotLoggedIn']}</message>
</redirect>
</exception>
<exception class="javax.faces.application.ViewExpiredException">
<redirect view-id="/errorExpired.xhtml" />
</exception>
<exception class="org.jboss.seam.ConcurrentRequestTimeoutException"
log-level="trace">
<http-error error-code="503" />
</exception>
<exception>
<redirect view-id="/error.xhtml">
<message severity="error">Unexpected error, please try again</message>
</redirect>
</exception>
xmlns="http://jboss.org/schema/seam/pages"
xsi:schemaLocation="http://jboss.org/schema/seam/pages http://jboss.org/schema/seam/pages-2.3.xsd">
<page view-id="*">
<navigation from-action="#{identity.logout}">
<rule if="#{applicationConfigurationManager.isCasEnable()}">
<redirect view-id="/cas/logout.xhtml"/>
</rule>
<rule if="#{!applicationPreferenceManager.isCasEnable()}">
<redirect view-id="/home.xhtml"/>
</rule>
</navigation>
</page>
<page view-id="/cas/login">
<navigation>
<redirect view-id="/home.xhtml"/>
</navigation>
</page>
<exception class="org.jboss.seam.framework.EntityNotFoundException">
<redirect view-id="/error.xhtml">
<message severity="warn">Record not found</message>
</redirect>
</exception>
<exception class="javax.persistence.EntityNotFoundException">
<redirect view-id="/error.xhtml">
<message severity="warn">Record not found</message>
</redirect>
</exception>
<exception class="javax.persistence.EntityExistsException">
<redirect view-id="/error.xhtml">
<message severity="warn">Duplicate record</message>
</redirect>
</exception>
<exception class="javax.persistence.OptimisticLockException">
<end-conversation/>
<redirect view-id="/error.xhtml">
<message severity="warn">Another user changed the same data, please try again</message>
</redirect>
</exception>
<exception class="org.jboss.seam.security.AuthorizationException">
<redirect view-id="/error.xhtml">
<message severity="error">You don't have permission to access this resource</message>
</redirect>
</exception>
<exception class="org.jboss.seam.security.NotLoggedInException">
<redirect view-id="/login.xhtml">
<message severity="warn">#{messages['org.jboss.seam.NotLoggedIn']}</message>
</redirect>
</exception>
<exception class="javax.faces.application.ViewExpiredException">
<redirect view-id="/errorExpired.xhtml"/>
</exception>
<exception class="org.jboss.seam.ConcurrentRequestTimeoutException"
log-level="trace">
<http-error error-code="503"/>
</exception>
<exception>
<redirect view-id="/error.xhtml">
<message severity="error">Unexpected error, please try again</message>
</redirect>
</exception>
</pages>
......@@ -89,10 +89,17 @@
<auth-constraint />
</security-constraint>
<!-- CAS -->
<listener>
<listener-class>org.jasig.cas.client.session.SingleSignOutHttpSessionListener</listener-class>
</listener>
<filter>
<context-param>
<param-name>configurationStrategy</param-name>
<param-value>PROPERTY_FILE</param-value>
</context-param>
<context-param>
<param-name>configFileLocation</param-name>
<param-value>/opt/gazelle/cas/file.properties</param-value>
</context-param>
<filter>
<filter-name>CAS Single Sign Out Filter</filter-name>
<filter-class>org.jasig.cas.client.session.SingleSignOutFilter</filter-class>
</filter>
......@@ -100,42 +107,42 @@
<filter-name>CAS Single Sign Out Filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter>
<filter-name>CAS Authentication Filter</filter-name>
<filter-class>net.ihe.gazelle.proxy.authentication.AuthenticationFilter</filter-class>
<init-param>
<param-name>casServerLoginUrl</param-name>
<param-value>http://changed.at.runtime</param-value>
</init-param>
<init-param>
<param-name>service</param-name>
<param-value>http://changed.at.runtime</param-value>
</init-param>
</filter>
<filter>
<filter-name>CAS Validation Filter</filter-name>
<filter-class>net.ihe.gazelle.proxy.authentication.Cas20ProxyReceivingTicketValidationFilter</filter-class>
<init-param>
<param-name>casServerUrlPrefix</param-name>
<param-value>http://changed.at.runtime</param-value>
</init-param>
<init-param>
<param-name>service</param-name>
<param-value>http://changed.at.runtime</param-value>
</init-param>
<listener>
<listener-class>org.jasig.cas.client.session.SingleSignOutHttpSessionListener</listener-class>
</listener>
<filter>
<filter-name>Gazelle CAS Authentication Filter</filter-name>
<filter-class>net.ihe.gazelle.cas.client.authentication.AuthenticationFilter</filter-class>
</filter>
<filter>
<filter-name>CAS HttpServletRequest Wrapper Filter</filter-name>
<filter-class>org.jasig.cas.client.util.HttpServletRequestWrapperFilter</filter-class>
<filter-mapping>
<filter-name>Gazelle CAS Authentication Filter</filter-name>
<url-pattern>/cas/login</url-pattern>
</filter-mapping>
<filter>
<filter-name>Gazelle CAS logout filter</filter-name>
<filter-class>net.ihe.gazelle.cas.client.authentication.LogoutFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>CAS Authentication Filter</filter-name>
<url-pattern>/cas/*</url-pattern>
<filter-name>Gazelle CAS logout filter</filter-name>
<url-pattern>/cas/logout.seam</url-pattern>
</filter-mapping>
<filter>
<filter-name>CAS Validation Filter</filter-name>
<filter-class>org.jasig.cas.client.validation.Cas30ProxyReceivingTicketValidationFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>CAS Validation 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>
......
<ui:composition xmlns:rich="http://richfaces.org/rich" xmlns:s="http://jboss.org/schema/seam/taglib"
xmlns:a4j="http://richfaces.org/a4j" xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html"
xmlns="http://www.w3.org/1999/xhtml">
<ui:composition
xmlns:a4j="http://richfaces.org/a4j" xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html"
xmlns="http://www.w3.org/1999/xhtml">
<h:form id="menuForm">
<ui:decorate template="/layout/menu/_menu_template.xhtml">
<ui:define name="menu_title">
......@@ -79,28 +79,29 @@
</a>
<ul class="dropdown-menu" role="menu">
<li>
<s:link id="menuLogoutId"
view="/home.seam"
action="#{identity.logout()}"
value="#{messages['net.ihe.gazelle.proxy.Logout']}"
propagation="none"/>
<h:commandLink immediate="true"
action="#{identity.logout}"
value="#{messages['net.ihe.gazelle.proxy.Logout']}"/>
</li>
</ul>
</li>
</h:panelGroup>
<h:panelGroup>
<h:panelGroup rendered="#{not identity.loggedIn and applicationConfigurationManager.isWorksWithoutCas()}">
<li>
<a4j:commandLink
value="#{messages['net.ihe.gazelle.proxy.Login']}"
styleClass="ipLogin" execute="@this"
action="#{applicationConfigurationManager.loginByIP()}"
rendered="#{not identity.loggedIn and applicationConfigurationManager.isWorksWithoutCas()}"/>
/>
</li>
</h:panelGroup>
<h:panelGroup rendered="#{not identity.loggedIn and not applicationConfigurationManager.isWorksWithoutCas()}">
<li>
<s:link id="menuLoginCasId"
view="/cas/home.seam" value="Login CAS"
rendered="#{not identity.loggedIn and not applicationConfigurationManager.isWorksWithoutCas()}"
propagation="none"/>
<h:outputLink id="menuLoginCasId" value="#{applicationConfigurationManager.getApplicationUrl()}/cas/login">
<h:outputText value="Login CAS"/>
<f:param name="request" value="#{request.requestURL}"/>
</h:outputLink>
</li>
</h:panelGroup>
</ui:define>
......
......@@ -4,14 +4,14 @@
<parent>
<groupId>net.ihe.gazelle.maven</groupId>
<artifactId>gazelle-tools</artifactId>
<version>3.0.36</version>
<version>3.0.39-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>net.ihe.gazelle.proxy</groupId>
<artifactId>gazelle-proxy</artifactId>
<packaging>pom</packaging>
<version>4.4.4-SNAPSHOT</version>
<version>4.5.0-SNAPSHOT</version>
<url>https://gazelle.ihe.net/proxy/</url>
<issueManagement>
......@@ -40,7 +40,8 @@
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<sonar.exclusions>file:**/src/main/webapp/resources/**/*.js</sonar.exclusions>
<gazelle.plugins.version>1.59</gazelle.plugins.version>
<gazelle.plugins.version>1.60</gazelle.plugins.version>
<gazelle.cas.client.version>1.0.0</gazelle.cas.client.version>
</properties>
<dependencyManagement>
......@@ -48,31 +49,31 @@
<dependency>
<groupId>net.ihe.gazelle.proxy</groupId>
<artifactId>gazelle-proxy-netty</artifactId>
<version>4.4.4-SNAPSHOT</version>
<version>4.5.0-SNAPSHOT</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>net.ihe.gazelle.proxy</groupId>
<artifactId>gazelle-proxy-jar</artifactId>
<version>4.4.4-SNAPSHOT</version>
<version>4.5.0-SNAPSHOT</version>
<type>ejb</type>
</dependency>
<dependency>
<groupId>net.ihe.gazelle.proxy</groupId>
<artifactId>gazelle-proxy-ejb</artifactId>
<version>4.4.4-SNAPSHOT</version>
<version>4.5.0-SNAPSHOT</version>
<type>ejb</type>
</dependency>
<dependency>
<groupId>net.ihe.gazelle.proxy</groupId>
<artifactId>gazelle-proxy-common-war</artifactId>
<version>4.4.4-SNAPSHOT</version>
<version>4.5.0-SNAPSHOT</version>
<type>war</type>
</dependency>
<dependency>
<groupId>net.ihe.gazelle.proxy</groupId>
<artifactId>gazelle-proxy-war</artifactId>
<version>4.4.4-SNAPSHOT</version>
<version>4.5.0-SNAPSHOT</version>
<type>war</type>
</dependency>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment