Compare commits
44 Commits
cas-client
...
master
| Author | SHA1 | Date |
|---|---|---|
|
|
c516025070 | |
|
|
71e71f15ff | |
|
|
448b08c43c | |
|
|
06f87f85fc | |
|
|
f2c44b7e74 | |
|
|
94d81c32ba | |
|
|
a96a13c630 | |
|
|
06f3ebc7c2 | |
|
|
0dce0aa69e | |
|
|
8a665e1cb1 | |
|
|
dce1a94d9a | |
|
|
76fb6a4f9c | |
|
|
8d38080354 | |
|
|
be803939d8 | |
|
|
af1bbb2f32 | |
|
|
c5a5a9961b | |
|
|
6e2fbec2a4 | |
|
|
638c2d6fe4 | |
|
|
efd6dbb491 | |
|
|
905ce61e82 | |
|
|
3ba892e482 | |
|
|
62cc93399f | |
|
|
cd67d874a2 | |
|
|
46381476e9 | |
|
|
d2538f378d | |
|
|
f14d836e03 | |
|
|
e2e4ea9fa1 | |
|
|
df89820368 | |
|
|
3005cc8607 | |
|
|
e0374d61ac | |
|
|
360ff59ddd | |
|
|
59f42b7edf | |
|
|
409bd553ba | |
|
|
3ec16e8aaf | |
|
|
08bedcf889 | |
|
|
da7ff03cff | |
|
|
5aaf09b3e4 | |
|
|
fd176bc1a7 | |
|
|
9f09c15673 | |
|
|
e4c1df0280 | |
|
|
a00064d1d8 | |
|
|
21d5f37322 | |
|
|
872fc49fb7 | |
|
|
18c79fcf00 |
|
|
@ -27,8 +27,8 @@ pull_request_rules:
|
||||||
- label=dependencies
|
- label=dependencies
|
||||||
actions:
|
actions:
|
||||||
merge:
|
merge:
|
||||||
method: merge
|
method: squash
|
||||||
strict: true
|
strict: false
|
||||||
delete_head_branch:
|
delete_head_branch:
|
||||||
- name: automatic merge by renovate
|
- name: automatic merge by renovate
|
||||||
conditions:
|
conditions:
|
||||||
|
|
@ -39,6 +39,6 @@ pull_request_rules:
|
||||||
- label=dependencies
|
- label=dependencies
|
||||||
actions:
|
actions:
|
||||||
merge:
|
merge:
|
||||||
method: merge
|
method: squash
|
||||||
strict: true
|
strict: false
|
||||||
delete_head_branch:
|
delete_head_branch:
|
||||||
|
|
|
||||||
13
README.md
13
README.md
|
|
@ -723,6 +723,7 @@ cas.validation-type=SAML
|
||||||
|
|
||||||
### Available optional properties
|
### Available optional properties
|
||||||
|
|
||||||
|
* `cas.single-logout.enabled`
|
||||||
* `cas.authentication-url-patterns`
|
* `cas.authentication-url-patterns`
|
||||||
* `cas.validation-url-patterns`
|
* `cas.validation-url-patterns`
|
||||||
* `cas.request-wrapper-url-patterns`
|
* `cas.request-wrapper-url-patterns`
|
||||||
|
|
@ -793,7 +794,7 @@ type="java.lang.String" value="https://www.apereo.org/cas"/>
|
||||||
### Configuring Single Sign Out
|
### Configuring Single Sign Out
|
||||||
The Single Sign Out support in CAS consists of configuring one `SingleSignOutFilter` and one `ContextListener`. Please note that if you have configured the CAS Client for Java as Web filters, this filter must come before the other filters as described.
|
The Single Sign Out support in CAS consists of configuring one `SingleSignOutFilter` and one `ContextListener`. Please note that if you have configured the CAS Client for Java as Web filters, this filter must come before the other filters as described.
|
||||||
|
|
||||||
The `SingleSignOutFilter` can affect character encoding. This becomes most obvious when used in conjunction with applications such as Atlassian Confluence. Its recommended you explicitly configure either the [VT Character Encoding Filter](http://code.google.com/p/vt-middleware/wiki/vtservletfilters#CharacterEncodingFilter) or the [Spring Character Encoding Filter](http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/web/filter/CharacterEncodingFilter.html) with explicit encodings.
|
The `SingleSignOutFilter` can affect character encoding. This becomes most obvious when used in conjunction with applications such as Atlassian Confluence. It's recommended you explicitly configure either the [VT Character Encoding Filter](http://code.google.com/p/vt-middleware/wiki/vtservletfilters#CharacterEncodingFilter) or the [Spring Character Encoding Filter](http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/web/filter/CharacterEncodingFilter.html) with explicit encodings.
|
||||||
|
|
||||||
#### Configuration
|
#### Configuration
|
||||||
|
|
||||||
|
|
@ -801,12 +802,10 @@ The `SingleSignOutFilter` can affect character encoding. This becomes most obvio
|
||||||
|----------|-------|-----------
|
|----------|-------|-----------
|
||||||
| `artifactParameterName` | The ticket artifact parameter name. Defaults to `ticket`| No
|
| `artifactParameterName` | The ticket artifact parameter name. Defaults to `ticket`| No
|
||||||
| `logoutParameterName` | Defaults to `logoutRequest` | No
|
| `logoutParameterName` | Defaults to `logoutRequest` | No
|
||||||
| `frontLogoutParameterName` | Defaults to `SAMLRequest` | No
|
|
||||||
| `relayStateParameterName` | Defaults to `RelayState` | No
|
| `relayStateParameterName` | Defaults to `RelayState` | No
|
||||||
| `eagerlyCreateSessions` | Defaults to `true` | No
|
| `eagerlyCreateSessions` | Defaults to `true` | No
|
||||||
| `artifactParameterOverPost` | Defaults to `false` | No
|
| `artifactParameterOverPost` | Defaults to `false` | No
|
||||||
| `logoutCallbackPath` | The path which is expected to receive logout callback requests from the CAS server. This is necessary if your app needs access to the raw input stream when handling form posts. If not configured, the default behavior will check every form post for a logout parameter. | No
|
| `logoutCallbackPath` | The path which is expected to receive logout callback requests from the CAS server. This is necessary if your app needs access to the raw input stream when handling form posts. If not configured, the default behavior will check every form post for a logout parameter. | No
|
||||||
| `casServerUrlPrefix` | URL to root of CAS Web application context. | Yes
|
|
||||||
|
|
||||||
<a name="cas-protocol"></a>
|
<a name="cas-protocol"></a>
|
||||||
#### CAS Protocol
|
#### CAS Protocol
|
||||||
|
|
@ -815,10 +814,6 @@ The `SingleSignOutFilter` can affect character encoding. This becomes most obvio
|
||||||
<filter>
|
<filter>
|
||||||
<filter-name>CAS Single Sign Out Filter</filter-name>
|
<filter-name>CAS Single Sign Out Filter</filter-name>
|
||||||
<filter-class>org.jasig.cas.client.session.SingleSignOutFilter</filter-class>
|
<filter-class>org.jasig.cas.client.session.SingleSignOutFilter</filter-class>
|
||||||
<init-param>
|
|
||||||
<param-name>casServerUrlPrefix</param-name>
|
|
||||||
<param-value>https://cas.example.com/cas</param-value>
|
|
||||||
</init-param>
|
|
||||||
</filter>
|
</filter>
|
||||||
...
|
...
|
||||||
<filter-mapping>
|
<filter-mapping>
|
||||||
|
|
@ -842,10 +837,6 @@ The `SingleSignOutFilter` can affect character encoding. This becomes most obvio
|
||||||
<param-name>artifactParameterName</param-name>
|
<param-name>artifactParameterName</param-name>
|
||||||
<param-value>SAMLart</param-value>
|
<param-value>SAMLart</param-value>
|
||||||
</init-param>
|
</init-param>
|
||||||
<init-param>
|
|
||||||
<param-name>casServerUrlPrefix</param-name>
|
|
||||||
<param-value>https://cas.example.com/cas</param-value>
|
|
||||||
</init-param>
|
|
||||||
</filter>
|
</filter>
|
||||||
...
|
...
|
||||||
<filter-mapping>
|
<filter-mapping>
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.jasig.cas.client</groupId>
|
<groupId>org.jasig.cas.client</groupId>
|
||||||
<version>3.6.0</version>
|
<version>3.6.2-SNAPSHOT</version>
|
||||||
<artifactId>cas-client</artifactId>
|
<artifactId>cas-client</artifactId>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
|
||||||
|
|
@ -82,6 +82,10 @@ public class AuthenticationFilter extends AbstractCasFilter {
|
||||||
|
|
||||||
private UrlPatternMatcherStrategy ignoreUrlPatternMatcherStrategyClass = null;
|
private UrlPatternMatcherStrategy ignoreUrlPatternMatcherStrategyClass = null;
|
||||||
|
|
||||||
|
private String internalIp = null;
|
||||||
|
|
||||||
|
private static final String X_REAL_IP = "x-real-ip";
|
||||||
|
|
||||||
private static final Map<String, Class<? extends UrlPatternMatcherStrategy>> PATTERN_MATCHER_TYPES =
|
private static final Map<String, Class<? extends UrlPatternMatcherStrategy>> PATTERN_MATCHER_TYPES =
|
||||||
new HashMap<String, Class<? extends UrlPatternMatcherStrategy>>();
|
new HashMap<String, Class<? extends UrlPatternMatcherStrategy>>();
|
||||||
|
|
||||||
|
|
@ -115,6 +119,7 @@ public class AuthenticationFilter extends AbstractCasFilter {
|
||||||
setRenew(getBoolean(ConfigurationKeys.RENEW));
|
setRenew(getBoolean(ConfigurationKeys.RENEW));
|
||||||
setGateway(getBoolean(ConfigurationKeys.GATEWAY));
|
setGateway(getBoolean(ConfigurationKeys.GATEWAY));
|
||||||
setMethod(getString(ConfigurationKeys.METHOD));
|
setMethod(getString(ConfigurationKeys.METHOD));
|
||||||
|
setInternalIp(getString(ConfigurationKeys.INTERNAL_IP));
|
||||||
|
|
||||||
final String ignorePattern = getString(ConfigurationKeys.IGNORE_PATTERN);
|
final String ignorePattern = getString(ConfigurationKeys.IGNORE_PATTERN);
|
||||||
final String ignoreUrlPatternType = getString(ConfigurationKeys.IGNORE_URL_PATTERN_TYPE);
|
final String ignoreUrlPatternType = getString(ConfigurationKeys.IGNORE_URL_PATTERN_TYPE);
|
||||||
|
|
@ -169,6 +174,12 @@ public class AuthenticationFilter extends AbstractCasFilter {
|
||||||
final HttpServletRequest request = (HttpServletRequest) servletRequest;
|
final HttpServletRequest request = (HttpServletRequest) servletRequest;
|
||||||
final HttpServletResponse response = (HttpServletResponse) servletResponse;
|
final HttpServletResponse response = (HttpServletResponse) servletResponse;
|
||||||
|
|
||||||
|
if (isInternalRequest(request)) {
|
||||||
|
logger.debug("Request is ignored [internal].");
|
||||||
|
filterChain.doFilter(request, response);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (isRequestUrlExcluded(request)) {
|
if (isRequestUrlExcluded(request)) {
|
||||||
logger.debug("Request is ignored.");
|
logger.debug("Request is ignored.");
|
||||||
filterChain.doFilter(request, response);
|
filterChain.doFilter(request, response);
|
||||||
|
|
@ -231,10 +242,24 @@ public class AuthenticationFilter extends AbstractCasFilter {
|
||||||
this.casServerLoginUrl = casServerLoginUrl;
|
this.casServerLoginUrl = casServerLoginUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setInternalIp(String internalIp) {
|
||||||
|
this.internalIp = internalIp;
|
||||||
|
}
|
||||||
|
|
||||||
public final void setGatewayStorage(final GatewayResolver gatewayStorage) {
|
public final void setGatewayStorage(final GatewayResolver gatewayStorage) {
|
||||||
this.gatewayStorage = gatewayStorage;
|
this.gatewayStorage = gatewayStorage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isInternalRequest(final HttpServletRequest request) {
|
||||||
|
if (this.internalIp == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
String realIp = request.getHeader(X_REAL_IP);
|
||||||
|
|
||||||
|
return this.internalIp.equals(realIp);
|
||||||
|
}
|
||||||
|
|
||||||
private boolean isRequestUrlExcluded(final HttpServletRequest request) {
|
private boolean isRequestUrlExcluded(final HttpServletRequest request) {
|
||||||
if (this.ignoreUrlPatternMatcherStrategyClass == null) {
|
if (this.ignoreUrlPatternMatcherStrategyClass == null) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,7 @@ public interface ConfigurationKeys {
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
ConfigurationKey<Boolean> DISABLE_XML_SCHEMA_VALIDATION = new ConfigurationKey<Boolean>("disableXmlSchemaValidation", Boolean.FALSE);
|
ConfigurationKey<Boolean> DISABLE_XML_SCHEMA_VALIDATION = new ConfigurationKey<Boolean>("disableXmlSchemaValidation", Boolean.FALSE);
|
||||||
|
ConfigurationKey<String> INTERNAL_IP = new ConfigurationKey<String>("internalIp", null);
|
||||||
ConfigurationKey<String> IGNORE_PATTERN = new ConfigurationKey<String>("ignorePattern", null);
|
ConfigurationKey<String> IGNORE_PATTERN = new ConfigurationKey<String>("ignorePattern", null);
|
||||||
ConfigurationKey<String> IGNORE_URL_PATTERN_TYPE = new ConfigurationKey<String>("ignoreUrlPatternType", "REGEX");
|
ConfigurationKey<String> IGNORE_URL_PATTERN_TYPE = new ConfigurationKey<String>("ignoreUrlPatternType", "REGEX");
|
||||||
ConfigurationKey<Class<? extends HostnameVerifier>> HOSTNAME_VERIFIER = new ConfigurationKey<Class<? extends HostnameVerifier>>("hostnameVerifier", null);
|
ConfigurationKey<Class<? extends HostnameVerifier>> HOSTNAME_VERIFIER = new ConfigurationKey<Class<? extends HostnameVerifier>>("hostnameVerifier", null);
|
||||||
|
|
|
||||||
|
|
@ -18,16 +18,6 @@
|
||||||
*/
|
*/
|
||||||
package org.jasig.cas.client.util;
|
package org.jasig.cas.client.util;
|
||||||
|
|
||||||
import java.io.*;
|
|
||||||
import java.net.HttpURLConnection;
|
|
||||||
import java.net.URL;
|
|
||||||
import java.net.URLEncoder;
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
import javax.net.ssl.SSLException;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
import org.jasig.cas.client.Protocol;
|
import org.jasig.cas.client.Protocol;
|
||||||
import org.jasig.cas.client.proxy.ProxyGrantingTicketStorage;
|
import org.jasig.cas.client.proxy.ProxyGrantingTicketStorage;
|
||||||
import org.jasig.cas.client.ssl.HttpURLConnectionFactory;
|
import org.jasig.cas.client.ssl.HttpURLConnectionFactory;
|
||||||
|
|
@ -37,6 +27,23 @@ import org.jasig.cas.client.validation.ProxyListEditor;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import javax.net.ssl.SSLException;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import java.io.Closeable;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.net.HttpURLConnection;
|
||||||
|
import java.net.URL;
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Common utilities so that we don't need to include Commons Lang.
|
* Common utilities so that we don't need to include Commons Lang.
|
||||||
*
|
*
|
||||||
|
|
@ -61,19 +68,20 @@ public final class CommonUtils {
|
||||||
|
|
||||||
private static final String SERVICE_PARAMETER_NAMES;
|
private static final String SERVICE_PARAMETER_NAMES;
|
||||||
|
|
||||||
private CommonUtils() {
|
|
||||||
// nothing to do
|
|
||||||
}
|
|
||||||
|
|
||||||
static {
|
static {
|
||||||
final Set<String> serviceParameterSet = new HashSet<String>(4);
|
final Set<String> serviceParameterSet = new HashSet<String>(4);
|
||||||
for (final Protocol protocol : Protocol.values()) {
|
for (final Protocol protocol : Protocol.values()) {
|
||||||
serviceParameterSet.add(protocol.getServiceParameterName());
|
serviceParameterSet.add(protocol.getServiceParameterName());
|
||||||
}
|
}
|
||||||
SERVICE_PARAMETER_NAMES = serviceParameterSet.toString()
|
SERVICE_PARAMETER_NAMES = serviceParameterSet.toString()
|
||||||
.replaceAll("\\[|\\]", "")
|
.replaceAll("\\[|\\]", "")
|
||||||
.replaceAll("\\s", "");
|
.replaceAll("\\s", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private CommonUtils() {
|
||||||
|
// nothing to do
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check whether the object is null or not. If it is, throw an exception and
|
* Check whether the object is null or not. If it is, throw an exception and
|
||||||
* display the message.
|
* display the message.
|
||||||
|
|
@ -183,15 +191,30 @@ public final class CommonUtils {
|
||||||
* @return the fully constructed redirect url.
|
* @return the fully constructed redirect url.
|
||||||
*/
|
*/
|
||||||
public static String constructRedirectUrl(final String casServerLoginUrl, final String serviceParameterName,
|
public static String constructRedirectUrl(final String casServerLoginUrl, final String serviceParameterName,
|
||||||
final String serviceUrl, final boolean renew, final boolean gateway, final String method) {
|
final String serviceUrl, final boolean renew, final boolean gateway, final String method) {
|
||||||
return casServerLoginUrl + (casServerLoginUrl.contains("?") ? "&" : "?") + serviceParameterName + "="
|
return casServerLoginUrl + (casServerLoginUrl.contains("?") ? "&" : "?") + serviceParameterName + "="
|
||||||
+ urlEncode(serviceUrl) + (renew ? "&renew=true" : "") + (gateway ? "&gateway=true" : "")
|
+ urlEncode(serviceUrl) + (renew ? "&renew=true" : "") + (gateway ? "&gateway=true" : "")
|
||||||
+ (method != null ? "&method=" + method : "");
|
+ (method != null ? "&method=" + method : "");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Construct redirect url to a CAS server.
|
||||||
|
*
|
||||||
|
* @param casServerLoginUrl the cas server login url
|
||||||
|
* @param serviceParameterName the service parameter name
|
||||||
|
* @param serviceUrl the service url
|
||||||
|
* @param renew the renew
|
||||||
|
* @param gateway the gateway
|
||||||
|
* @return the string
|
||||||
|
*/
|
||||||
|
public static String constructRedirectUrl(final String casServerLoginUrl, final String serviceParameterName,
|
||||||
|
final String serviceUrl, final boolean renew, final boolean gateway) {
|
||||||
|
return constructRedirectUrl(casServerLoginUrl, serviceParameterName, serviceUrl, renew, gateway, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Url encode a value using UTF-8 encoding.
|
* Url encode a value using UTF-8 encoding.
|
||||||
*
|
*
|
||||||
* @param value the value to encode.
|
* @param value the value to encode.
|
||||||
* @return the encoded value.
|
* @return the encoded value.
|
||||||
*/
|
*/
|
||||||
|
|
@ -204,8 +227,8 @@ public final class CommonUtils {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void readAndRespondToProxyReceptorRequest(final HttpServletRequest request,
|
public static void readAndRespondToProxyReceptorRequest(final HttpServletRequest request,
|
||||||
final HttpServletResponse response, final ProxyGrantingTicketStorage proxyGrantingTicketStorage)
|
final HttpServletResponse response, final ProxyGrantingTicketStorage proxyGrantingTicketStorage)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
final String proxyGrantingTicketIou = request.getParameter(PARAM_PROXY_GRANTING_TICKET_IOU);
|
final String proxyGrantingTicketIou = request.getParameter(PARAM_PROXY_GRANTING_TICKET_IOU);
|
||||||
|
|
||||||
final String proxyGrantingTicket = request.getParameter(PARAM_PROXY_GRANTING_TICKET);
|
final String proxyGrantingTicket = request.getParameter(PARAM_PROXY_GRANTING_TICKET);
|
||||||
|
|
@ -216,12 +239,12 @@ public final class CommonUtils {
|
||||||
}
|
}
|
||||||
|
|
||||||
LOGGER.debug("Received proxyGrantingTicketId [{}] for proxyGrantingTicketIou [{}]", proxyGrantingTicket,
|
LOGGER.debug("Received proxyGrantingTicketId [{}] for proxyGrantingTicketIou [{}]", proxyGrantingTicket,
|
||||||
proxyGrantingTicketIou);
|
proxyGrantingTicketIou);
|
||||||
|
|
||||||
proxyGrantingTicketStorage.save(proxyGrantingTicketIou, proxyGrantingTicket);
|
proxyGrantingTicketStorage.save(proxyGrantingTicketIou, proxyGrantingTicket);
|
||||||
|
|
||||||
LOGGER.debug("Successfully saved proxyGrantingTicketId [{}] for proxyGrantingTicketIou [{}]",
|
LOGGER.debug("Successfully saved proxyGrantingTicketId [{}] for proxyGrantingTicketIou [{}]",
|
||||||
proxyGrantingTicket, proxyGrantingTicketIou);
|
proxyGrantingTicket, proxyGrantingTicketIou);
|
||||||
|
|
||||||
response.getWriter().write("<?xml version=\"1.0\"?>");
|
response.getWriter().write("<?xml version=\"1.0\"?>");
|
||||||
response.getWriter().write("<casClient:proxySuccess xmlns:casClient=\"http://www.yale.edu/tp/casClient\" />");
|
response.getWriter().write("<casClient:proxySuccess xmlns:casClient=\"http://www.yale.edu/tp/casClient\" />");
|
||||||
|
|
@ -254,7 +277,7 @@ public final class CommonUtils {
|
||||||
|
|
||||||
return serverNames[0];
|
return serverNames[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean requestIsOnStandardPort(final HttpServletRequest request) {
|
private static boolean requestIsOnStandardPort(final HttpServletRequest request) {
|
||||||
final int serverPort = request.getServerPort();
|
final int serverPort = request.getServerPort();
|
||||||
return serverPort == 80 || serverPort == 443;
|
return serverPort == 80 || serverPort == 443;
|
||||||
|
|
@ -281,7 +304,7 @@ public final class CommonUtils {
|
||||||
final String service, final String serverNames,
|
final String service, final String serverNames,
|
||||||
final String artifactParameterName, final boolean encode) {
|
final String artifactParameterName, final boolean encode) {
|
||||||
return constructServiceUrl(request, response, service, serverNames, SERVICE_PARAMETER_NAMES
|
return constructServiceUrl(request, response, service, serverNames, SERVICE_PARAMETER_NAMES
|
||||||
, artifactParameterName, encode);
|
, artifactParameterName, encode);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -301,8 +324,8 @@ public final class CommonUtils {
|
||||||
* @return the service url to use.
|
* @return the service url to use.
|
||||||
*/
|
*/
|
||||||
public static String constructServiceUrl(final HttpServletRequest request, final HttpServletResponse response,
|
public static String constructServiceUrl(final HttpServletRequest request, final HttpServletResponse response,
|
||||||
final String service, final String serverNames, final String serviceParameterName,
|
final String service, final String serverNames, final String serviceParameterName,
|
||||||
final String artifactParameterName, final boolean encode) {
|
final String artifactParameterName, final boolean encode) {
|
||||||
if (CommonUtils.isNotBlank(service)) {
|
if (CommonUtils.isNotBlank(service)) {
|
||||||
return encode ? response.encodeURL(service) : service;
|
return encode ? response.encodeURL(service) : service;
|
||||||
}
|
}
|
||||||
|
|
@ -330,10 +353,10 @@ public final class CommonUtils {
|
||||||
for (final URIBuilder.BasicNameValuePair pair : originalRequestUrl.getQueryParams()) {
|
for (final URIBuilder.BasicNameValuePair pair : originalRequestUrl.getQueryParams()) {
|
||||||
final String name = pair.getName();
|
final String name = pair.getName();
|
||||||
if (!name.equals(artifactParameterName) && !serviceParameterNames.contains(name)) {
|
if (!name.equals(artifactParameterName) && !serviceParameterNames.contains(name)) {
|
||||||
if (name.contains("&") || name.contains("=") ){
|
if (name.contains("&") || name.contains("=")) {
|
||||||
final URIBuilder encodedParamBuilder = new URIBuilder();
|
final URIBuilder encodedParamBuilder = new URIBuilder();
|
||||||
encodedParamBuilder.setParameters(name);
|
encodedParamBuilder.setParameters(name);
|
||||||
for (final URIBuilder.BasicNameValuePair pair2 :encodedParamBuilder.getQueryParams()){
|
for (final URIBuilder.BasicNameValuePair pair2 : encodedParamBuilder.getQueryParams()) {
|
||||||
final String name2 = pair2.getName();
|
final String name2 = pair2.getName();
|
||||||
if (!name2.equals(artifactParameterName) && !serviceParameterNames.contains(name2)) {
|
if (!name2.equals(artifactParameterName) && !serviceParameterNames.contains(name2)) {
|
||||||
builder.addParameter(name2, pair2.getValue());
|
builder.addParameter(name2, pair2.getValue());
|
||||||
|
|
@ -369,13 +392,13 @@ public final class CommonUtils {
|
||||||
* @return the value of the parameter.
|
* @return the value of the parameter.
|
||||||
*/
|
*/
|
||||||
public static String safeGetParameter(final HttpServletRequest request, final String parameter,
|
public static String safeGetParameter(final HttpServletRequest request, final String parameter,
|
||||||
final List<String> parameters) {
|
final List<String> parameters) {
|
||||||
if ("POST".equals(request.getMethod()) && parameters.contains(parameter)) {
|
if ("POST".equals(request.getMethod()) && parameters.contains(parameter)) {
|
||||||
LOGGER.debug("safeGetParameter called on a POST HttpServletRequest for Restricted Parameters. Cannot complete check safely. Reverting to standard behavior for this Parameter");
|
LOGGER.debug("safeGetParameter called on a POST HttpServletRequest for Restricted Parameters. Cannot complete check safely. Reverting to standard behavior for this Parameter");
|
||||||
return request.getParameter(parameter);
|
return request.getParameter(parameter);
|
||||||
}
|
}
|
||||||
return request.getQueryString() == null || !request.getQueryString().contains(parameter) ? null : request
|
return request.getQueryString() == null || !request.getQueryString().contains(parameter) ? null : request
|
||||||
.getParameter(parameter);
|
.getParameter(parameter);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String safeGetParameter(final HttpServletRequest request, final String parameter) {
|
public static String safeGetParameter(final HttpServletRequest request, final String parameter) {
|
||||||
|
|
@ -392,11 +415,11 @@ public final class CommonUtils {
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public static String getResponseFromServer(final String constructedUrl, final String encoding) {
|
public static String getResponseFromServer(final String constructedUrl, final String encoding) {
|
||||||
try {
|
try {
|
||||||
return getResponseFromServer(new URL(constructedUrl), DEFAULT_URL_CONNECTION_FACTORY, encoding);
|
return getResponseFromServer(new URL(constructedUrl), DEFAULT_URL_CONNECTION_FACTORY, encoding);
|
||||||
} catch (final IOException e) {
|
} catch (final IOException e) {
|
||||||
throw new RuntimeException(e.getMessage(), e);
|
throw new RuntimeException(e.getMessage(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
|
@ -413,8 +436,8 @@ public final class CommonUtils {
|
||||||
* @return the response.
|
* @return the response.
|
||||||
*/
|
*/
|
||||||
public static String getResponseFromServer(final URL constructedUrl, final HttpURLConnectionFactory factory,
|
public static String getResponseFromServer(final URL constructedUrl, final HttpURLConnectionFactory factory,
|
||||||
final String encoding) {
|
final String encoding) {
|
||||||
|
|
||||||
HttpURLConnection conn = null;
|
HttpURLConnection conn = null;
|
||||||
InputStreamReader in = null;
|
InputStreamReader in = null;
|
||||||
try {
|
try {
|
||||||
|
|
@ -434,13 +457,13 @@ public final class CommonUtils {
|
||||||
|
|
||||||
return builder.toString();
|
return builder.toString();
|
||||||
} catch (final RuntimeException e) {
|
} catch (final RuntimeException e) {
|
||||||
throw e;
|
throw e;
|
||||||
} catch (final SSLException e) {
|
} catch (final SSLException e) {
|
||||||
LOGGER.error("SSL error getting response from host: {} : Error Message: {}", constructedUrl.getHost(), e.getMessage(), e);
|
LOGGER.error("SSL error getting response from host: {} : Error Message: {}", constructedUrl.getHost(), e.getMessage(), e);
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
} catch (final IOException e) {
|
} catch (final IOException e) {
|
||||||
LOGGER.error("Error getting response from host: [{}] with path: [{}] and protocol: [{}] Error Message: {}",
|
LOGGER.error("Error getting response from host: [{}] with path: [{}] and protocol: [{}] Error Message: {}",
|
||||||
constructedUrl.getHost(), constructedUrl.getPath(), constructedUrl.getProtocol(), e.getMessage(), e);
|
constructedUrl.getHost(), constructedUrl.getPath(), constructedUrl.getProtocol(), e.getMessage(), e);
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
} finally {
|
} finally {
|
||||||
closeQuietly(in);
|
closeQuietly(in);
|
||||||
|
|
@ -574,11 +597,11 @@ public final class CommonUtils {
|
||||||
case 1: {
|
case 1: {
|
||||||
final char ch0 = str.charAt(0);
|
final char ch0 = str.charAt(0);
|
||||||
if (ch0 == 'y' || ch0 == 'Y' ||
|
if (ch0 == 'y' || ch0 == 'Y' ||
|
||||||
ch0 == 't' || ch0 == 'T') {
|
ch0 == 't' || ch0 == 'T') {
|
||||||
return Boolean.TRUE;
|
return Boolean.TRUE;
|
||||||
}
|
}
|
||||||
if (ch0 == 'n' || ch0 == 'N' ||
|
if (ch0 == 'n' || ch0 == 'N' ||
|
||||||
ch0 == 'f' || ch0 == 'F') {
|
ch0 == 'f' || ch0 == 'F') {
|
||||||
return Boolean.FALSE;
|
return Boolean.FALSE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -587,11 +610,11 @@ public final class CommonUtils {
|
||||||
final char ch0 = str.charAt(0);
|
final char ch0 = str.charAt(0);
|
||||||
final char ch1 = str.charAt(1);
|
final char ch1 = str.charAt(1);
|
||||||
if ((ch0 == 'o' || ch0 == 'O') &&
|
if ((ch0 == 'o' || ch0 == 'O') &&
|
||||||
(ch1 == 'n' || ch1 == 'N') ) {
|
(ch1 == 'n' || ch1 == 'N')) {
|
||||||
return Boolean.TRUE;
|
return Boolean.TRUE;
|
||||||
}
|
}
|
||||||
if ((ch0 == 'n' || ch0 == 'N') &&
|
if ((ch0 == 'n' || ch0 == 'N') &&
|
||||||
(ch1 == 'o' || ch1 == 'O') ) {
|
(ch1 == 'o' || ch1 == 'O')) {
|
||||||
return Boolean.FALSE;
|
return Boolean.FALSE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -601,13 +624,13 @@ public final class CommonUtils {
|
||||||
final char ch1 = str.charAt(1);
|
final char ch1 = str.charAt(1);
|
||||||
final char ch2 = str.charAt(2);
|
final char ch2 = str.charAt(2);
|
||||||
if ((ch0 == 'y' || ch0 == 'Y') &&
|
if ((ch0 == 'y' || ch0 == 'Y') &&
|
||||||
(ch1 == 'e' || ch1 == 'E') &&
|
(ch1 == 'e' || ch1 == 'E') &&
|
||||||
(ch2 == 's' || ch2 == 'S') ) {
|
(ch2 == 's' || ch2 == 'S')) {
|
||||||
return Boolean.TRUE;
|
return Boolean.TRUE;
|
||||||
}
|
}
|
||||||
if ((ch0 == 'o' || ch0 == 'O') &&
|
if ((ch0 == 'o' || ch0 == 'O') &&
|
||||||
(ch1 == 'f' || ch1 == 'F') &&
|
(ch1 == 'f' || ch1 == 'F') &&
|
||||||
(ch2 == 'f' || ch2 == 'F') ) {
|
(ch2 == 'f' || ch2 == 'F')) {
|
||||||
return Boolean.FALSE;
|
return Boolean.FALSE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -618,9 +641,9 @@ public final class CommonUtils {
|
||||||
final char ch2 = str.charAt(2);
|
final char ch2 = str.charAt(2);
|
||||||
final char ch3 = str.charAt(3);
|
final char ch3 = str.charAt(3);
|
||||||
if ((ch0 == 't' || ch0 == 'T') &&
|
if ((ch0 == 't' || ch0 == 'T') &&
|
||||||
(ch1 == 'r' || ch1 == 'R') &&
|
(ch1 == 'r' || ch1 == 'R') &&
|
||||||
(ch2 == 'u' || ch2 == 'U') &&
|
(ch2 == 'u' || ch2 == 'U') &&
|
||||||
(ch3 == 'e' || ch3 == 'E') ) {
|
(ch3 == 'e' || ch3 == 'E')) {
|
||||||
return Boolean.TRUE;
|
return Boolean.TRUE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -632,10 +655,10 @@ public final class CommonUtils {
|
||||||
final char ch3 = str.charAt(3);
|
final char ch3 = str.charAt(3);
|
||||||
final char ch4 = str.charAt(4);
|
final char ch4 = str.charAt(4);
|
||||||
if ((ch0 == 'f' || ch0 == 'F') &&
|
if ((ch0 == 'f' || ch0 == 'F') &&
|
||||||
(ch1 == 'a' || ch1 == 'A') &&
|
(ch1 == 'a' || ch1 == 'A') &&
|
||||||
(ch2 == 'l' || ch2 == 'L') &&
|
(ch2 == 'l' || ch2 == 'L') &&
|
||||||
(ch3 == 's' || ch3 == 'S') &&
|
(ch3 == 's' || ch3 == 'S') &&
|
||||||
(ch4 == 'e' || ch4 == 'E') ) {
|
(ch4 == 'e' || ch4 == 'E')) {
|
||||||
return Boolean.FALSE;
|
return Boolean.FALSE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -691,7 +714,7 @@ public final class CommonUtils {
|
||||||
* @return the int represented by the string, or the default if conversion fails
|
* @return the int represented by the string, or the default if conversion fails
|
||||||
*/
|
*/
|
||||||
public static int toInt(final String str, final int defaultValue) {
|
public static int toInt(final String str, final int defaultValue) {
|
||||||
if(str == null) {
|
if (str == null) {
|
||||||
return defaultValue;
|
return defaultValue;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.jasig.cas.client</groupId>
|
<groupId>org.jasig.cas.client</groupId>
|
||||||
<version>3.6.0-SNAPSHOT</version>
|
<version>3.6.1</version>
|
||||||
<artifactId>cas-client</artifactId>
|
<artifactId>cas-client</artifactId>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.jasig.cas.client</groupId>
|
<groupId>org.jasig.cas.client</groupId>
|
||||||
<version>3.6.0</version>
|
<version>3.6.2-SNAPSHOT</version>
|
||||||
<artifactId>cas-client</artifactId>
|
<artifactId>cas-client</artifactId>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>cas-client</artifactId>
|
<artifactId>cas-client</artifactId>
|
||||||
<groupId>org.jasig.cas.client</groupId>
|
<groupId>org.jasig.cas.client</groupId>
|
||||||
<version>3.6.0</version>
|
<version>3.6.2-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|
@ -33,7 +33,7 @@
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<!-- Note Jetty 9.2.x is the last version to support Java SE 7 -->
|
<!-- Note Jetty 9.2.x is the last version to support Java SE 7 -->
|
||||||
<jetty.version>9.4.21.v20190926</jetty.version>
|
<jetty.version>9.4.25.v20191220</jetty.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>cas-client</artifactId>
|
<artifactId>cas-client</artifactId>
|
||||||
<groupId>org.jasig.cas.client</groupId>
|
<groupId>org.jasig.cas.client</groupId>
|
||||||
<version>3.6.0</version>
|
<version>3.6.2-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>cas-client</artifactId>
|
<artifactId>cas-client</artifactId>
|
||||||
<groupId>org.jasig.cas.client</groupId>
|
<groupId>org.jasig.cas.client</groupId>
|
||||||
<version>3.6.0</version>
|
<version>3.6.2-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>cas-client</artifactId>
|
<artifactId>cas-client</artifactId>
|
||||||
<groupId>org.jasig.cas.client</groupId>
|
<groupId>org.jasig.cas.client</groupId>
|
||||||
<version>3.6.0</version>
|
<version>3.6.2-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|
@ -50,7 +50,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.tomcat</groupId>
|
<groupId>org.apache.tomcat</groupId>
|
||||||
<artifactId>tomcat-catalina</artifactId>
|
<artifactId>tomcat-catalina</artifactId>
|
||||||
<version>7.0.96</version>
|
<version>7.0.99</version>
|
||||||
<type>jar</type>
|
<type>jar</type>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>cas-client</artifactId>
|
<artifactId>cas-client</artifactId>
|
||||||
<groupId>org.jasig.cas.client</groupId>
|
<groupId>org.jasig.cas.client</groupId>
|
||||||
<version>3.6.0</version>
|
<version>3.6.2-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|
@ -50,7 +50,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.tomcat</groupId>
|
<groupId>org.apache.tomcat</groupId>
|
||||||
<artifactId>tomcat-catalina</artifactId>
|
<artifactId>tomcat-catalina</artifactId>
|
||||||
<version>8.5.46</version>
|
<version>8.5.50</version>
|
||||||
<type>jar</type>
|
<type>jar</type>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>cas-client</artifactId>
|
<artifactId>cas-client</artifactId>
|
||||||
<groupId>org.jasig.cas.client</groupId>
|
<groupId>org.jasig.cas.client</groupId>
|
||||||
<version>3.6.0</version>
|
<version>3.6.2-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|
@ -50,14 +50,14 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.tomcat.embed</groupId>
|
<groupId>org.apache.tomcat.embed</groupId>
|
||||||
<artifactId>tomcat-embed-core</artifactId>
|
<artifactId>tomcat-embed-core</artifactId>
|
||||||
<version>8.5.46</version>
|
<version>8.5.50</version>
|
||||||
<type>jar</type>
|
<type>jar</type>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.tomcat</groupId>
|
<groupId>org.apache.tomcat</groupId>
|
||||||
<artifactId>tomcat-catalina</artifactId>
|
<artifactId>tomcat-catalina</artifactId>
|
||||||
<version>8.5.46</version>
|
<version>8.5.50</version>
|
||||||
<type>jar</type>
|
<type>jar</type>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>cas-client</artifactId>
|
<artifactId>cas-client</artifactId>
|
||||||
<groupId>org.jasig.cas.client</groupId>
|
<groupId>org.jasig.cas.client</groupId>
|
||||||
<version>3.6.0</version>
|
<version>3.6.2-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|
@ -32,7 +32,7 @@
|
||||||
<name>Jasig CAS Client for Java - Tomcat 9.0.x Integration</name>
|
<name>Jasig CAS Client for Java - Tomcat 9.0.x Integration</name>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<tomcat.version>9.0.26</tomcat.version>
|
<tomcat.version>9.0.30</tomcat.version>
|
||||||
</properties>
|
</properties>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>cas-client</artifactId>
|
<artifactId>cas-client</artifactId>
|
||||||
<groupId>org.jasig.cas.client</groupId>
|
<groupId>org.jasig.cas.client</groupId>
|
||||||
<version>3.6.0</version>
|
<version>3.6.2-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<name>Jasig CAS Client for Java - Distributed Proxy Storage Support: EhCache
|
<name>Jasig CAS Client for Java - Distributed Proxy Storage Support: EhCache
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>cas-client</artifactId>
|
<artifactId>cas-client</artifactId>
|
||||||
<groupId>org.jasig.cas.client</groupId>
|
<groupId>org.jasig.cas.client</groupId>
|
||||||
<version>3.6.0</version>
|
<version>3.6.2-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.jasig.cas.client</groupId>
|
<groupId>org.jasig.cas.client</groupId>
|
||||||
<version>3.6.0</version>
|
<version>3.6.2-SNAPSHOT</version>
|
||||||
<artifactId>cas-client</artifactId>
|
<artifactId>cas-client</artifactId>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
@ -38,7 +38,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>joda-time</groupId>
|
<groupId>joda-time</groupId>
|
||||||
<artifactId>joda-time</artifactId>
|
<artifactId>joda-time</artifactId>
|
||||||
<version>2.10.4</version>
|
<version>2.10.5</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Test dependencies -->
|
<!-- Test dependencies -->
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.jasig.cas.client</groupId>
|
<groupId>org.jasig.cas.client</groupId>
|
||||||
<version>3.6.0</version>
|
<version>3.6.2-SNAPSHOT</version>
|
||||||
<artifactId>cas-client</artifactId>
|
<artifactId>cas-client</artifactId>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
@ -58,6 +58,15 @@
|
||||||
<artifactId>spring-context</artifactId>
|
<artifactId>spring-context</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||||
|
<optional>true</optional>
|
||||||
|
<version>${springboot.version}</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- Test dependencies -->
|
<!-- Test dependencies -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.jasig.cas.client</groupId>
|
<groupId>org.jasig.cas.client</groupId>
|
||||||
|
|
@ -74,6 +83,6 @@
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<springboot.version>2.1.9.RELEASE</springboot.version>
|
<springboot.version>2.2.2.RELEASE</springboot.version>
|
||||||
</properties>
|
</properties>
|
||||||
</project>
|
</project>
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,8 @@ package org.jasig.cas.client.boot.configuration;
|
||||||
|
|
||||||
import org.jasig.cas.client.authentication.AuthenticationFilter;
|
import org.jasig.cas.client.authentication.AuthenticationFilter;
|
||||||
import org.jasig.cas.client.authentication.Saml11AuthenticationFilter;
|
import org.jasig.cas.client.authentication.Saml11AuthenticationFilter;
|
||||||
|
import org.jasig.cas.client.session.SingleSignOutFilter;
|
||||||
|
import org.jasig.cas.client.session.SingleSignOutHttpSessionListener;
|
||||||
import org.jasig.cas.client.util.AssertionThreadLocalFilter;
|
import org.jasig.cas.client.util.AssertionThreadLocalFilter;
|
||||||
import org.jasig.cas.client.util.HttpServletRequestWrapperFilter;
|
import org.jasig.cas.client.util.HttpServletRequestWrapperFilter;
|
||||||
import org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter;
|
import org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter;
|
||||||
|
|
@ -29,8 +31,10 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||||
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||||
|
import org.springframework.boot.web.servlet.ServletListenerRegistrationBean;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.core.Ordered;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
|
|
@ -40,6 +44,7 @@ import java.util.Collection;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.EventListener;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configuration class providing default CAS client infrastructure filters.
|
* Configuration class providing default CAS client infrastructure filters.
|
||||||
|
|
@ -199,4 +204,25 @@ public class CasClientConfiguration {
|
||||||
}
|
}
|
||||||
this.casClientConfigurer = configurers.iterator().next();
|
this.casClientConfigurer = configurers.iterator().next();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
@ConditionalOnProperty(prefix = "cas", value = "single-logout.enabled", havingValue = "true")
|
||||||
|
public FilterRegistrationBean casSingleSignOutFilter() {
|
||||||
|
final FilterRegistrationBean singleSignOutFilter = new FilterRegistrationBean();
|
||||||
|
singleSignOutFilter.setFilter(new SingleSignOutFilter());
|
||||||
|
Map<String,String> initParameters = new HashMap<>(1);
|
||||||
|
initParameters.put("casServerUrlPrefix", configProps.getServerUrlPrefix());
|
||||||
|
singleSignOutFilter.setInitParameters(initParameters);
|
||||||
|
singleSignOutFilter.setOrder(Ordered.HIGHEST_PRECEDENCE);
|
||||||
|
return singleSignOutFilter;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
@ConditionalOnProperty(prefix = "cas", value = "single-logout.enabled", havingValue = "true")
|
||||||
|
public ServletListenerRegistrationBean<EventListener> casSingleSignOutListener(){
|
||||||
|
ServletListenerRegistrationBean<EventListener> singleSignOutListener = new ServletListenerRegistrationBean<>();
|
||||||
|
singleSignOutListener.setListener(new SingleSignOutHttpSessionListener());
|
||||||
|
singleSignOutListener.setOrder(Ordered.HIGHEST_PRECEDENCE);
|
||||||
|
return singleSignOutListener;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -115,6 +115,24 @@ public class CasClientConfigurationProperties {
|
||||||
|
|
||||||
private Boolean skipTicketValidation = false;
|
private Boolean skipTicketValidation = false;
|
||||||
|
|
||||||
|
private SingleLogout singleLogout;
|
||||||
|
|
||||||
|
public static class SingleLogout{
|
||||||
|
/**
|
||||||
|
* whether to receive the single logout request from cas server.
|
||||||
|
*/
|
||||||
|
private boolean enabled = false;
|
||||||
|
|
||||||
|
public boolean isEnabled() {
|
||||||
|
return enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEnabled(boolean enabled) {
|
||||||
|
this.enabled = enabled;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public String getServerUrlPrefix() {
|
public String getServerUrlPrefix() {
|
||||||
return serverUrlPrefix;
|
return serverUrlPrefix;
|
||||||
}
|
}
|
||||||
|
|
@ -242,4 +260,13 @@ public class CasClientConfigurationProperties {
|
||||||
public void setSkipTicketValidation(final Boolean skipTicketValidation) {
|
public void setSkipTicketValidation(final Boolean skipTicketValidation) {
|
||||||
this.skipTicketValidation = skipTicketValidation;
|
this.skipTicketValidation = skipTicketValidation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public SingleLogout getSingleLogout() {
|
||||||
|
return singleLogout;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSingleLogout(SingleLogout singleLogout) {
|
||||||
|
this.singleLogout = singleLogout;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
20
pom.xml
20
pom.xml
|
|
@ -26,7 +26,7 @@
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>org.jasig.cas.client</groupId>
|
<groupId>org.jasig.cas.client</groupId>
|
||||||
<version>3.6.0</version>
|
<version>3.6.2-SNAPSHOT</version>
|
||||||
<artifactId>cas-client</artifactId>
|
<artifactId>cas-client</artifactId>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
|
|
@ -41,7 +41,7 @@
|
||||||
<connection>scm:git:git@github.com:apereo/java-cas-client.git</connection>
|
<connection>scm:git:git@github.com:apereo/java-cas-client.git</connection>
|
||||||
<developerConnection>scm:git:git@github.com:apereo/java-cas-client.git</developerConnection>
|
<developerConnection>scm:git:git@github.com:apereo/java-cas-client.git</developerConnection>
|
||||||
<url>https://github.com/apereo/java-cas-client</url>
|
<url>https://github.com/apereo/java-cas-client</url>
|
||||||
<tag>cas-client-3.6.0</tag>
|
<tag>HEAD</tag>
|
||||||
</scm>
|
</scm>
|
||||||
|
|
||||||
<inceptionYear>2006</inceptionYear>
|
<inceptionYear>2006</inceptionYear>
|
||||||
|
|
@ -79,7 +79,7 @@
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-assembly-plugin</artifactId>
|
<artifactId>maven-assembly-plugin</artifactId>
|
||||||
<version>3.1.1</version>
|
<version>3.2.0</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<descriptors>
|
<descriptors>
|
||||||
<descriptor>${basedir}/assembly.xml</descriptor>
|
<descriptor>${basedir}/assembly.xml</descriptor>
|
||||||
|
|
@ -109,7 +109,7 @@
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-source-plugin</artifactId>
|
<artifactId>maven-source-plugin</artifactId>
|
||||||
<version>3.1.0</version>
|
<version>3.2.1</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>attach-sources</id>
|
<id>attach-sources</id>
|
||||||
|
|
@ -144,8 +144,8 @@
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>com.mycila.maven-license-plugin</groupId>
|
<groupId>com.mycila</groupId>
|
||||||
<artifactId>maven-license-plugin</artifactId>
|
<artifactId>license-maven-plugin</artifactId>
|
||||||
<configuration>
|
<configuration>
|
||||||
<header>src/licensing/header.txt</header>
|
<header>src/licensing/header.txt</header>
|
||||||
<skipExistingHeaders>true</skipExistingHeaders>
|
<skipExistingHeaders>true</skipExistingHeaders>
|
||||||
|
|
@ -268,7 +268,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bouncycastle</groupId>
|
<groupId>org.bouncycastle</groupId>
|
||||||
<artifactId>bcpkix-jdk15on</artifactId>
|
<artifactId>bcpkix-jdk15on</artifactId>
|
||||||
<version>1.63</version>
|
<version>1.64</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
@ -309,10 +309,10 @@
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<spring.version>5.2.0.RELEASE</spring.version>
|
<spring.version>5.2.2.RELEASE</spring.version>
|
||||||
<ehcache.version>2.6.11</ehcache.version>
|
<ehcache.version>2.6.11</ehcache.version>
|
||||||
<clover.version>3.0.2</clover.version>
|
<clover.version>3.0.2</clover.version>
|
||||||
<slf4j.version>1.7.28</slf4j.version>
|
<slf4j.version>1.7.30</slf4j.version>
|
||||||
<jackson.version>2.10.0</jackson.version>
|
<jackson.version>2.10.1</jackson.version>
|
||||||
</properties>
|
</properties>
|
||||||
</project>
|
</project>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue