no message
This commit is contained in:
parent
fc8d735af9
commit
7268afa0f4
|
|
@ -151,5 +151,9 @@
|
|||
</orderEntry>
|
||||
<orderEntryProperties />
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<option name="ACTIVE_VCS_NAME" value="CVS" />
|
||||
<option name="USE_PROJECT_VCS" value="false" />
|
||||
</component>
|
||||
</module>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
<settings>
|
||||
<mirrors>
|
||||
<mirrorOf>central</mirrorOf>
|
||||
<name>JA-SIG Maven Repository</name>
|
||||
<url>http://developer.ja-sig.org/maven/</url>
|
||||
<id>jasig</id>
|
||||
</mirrors>
|
||||
<mirrors>
|
||||
<mirrorOf>central</mirrorOf>
|
||||
<name>JA-SIG Maven Repository</name>
|
||||
<url>http://developer.ja-sig.org/maven/</url>
|
||||
<id>jasig</id>
|
||||
</mirrors>
|
||||
</settings>
|
||||
|
|
@ -7,22 +7,18 @@ package org.jasig.cas.client.authorization;
|
|||
|
||||
/**
|
||||
* Exception to be thrown if the user is not authorized to use the system.
|
||||
*
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
*/
|
||||
public class AuthorizationException extends RuntimeException {
|
||||
public final class AuthorizationException extends RuntimeException {
|
||||
|
||||
/**
|
||||
* Unique ID for serialization.
|
||||
*/
|
||||
private static final long serialVersionUID = 5912038088650643442L;
|
||||
|
||||
public AuthorizationException() {
|
||||
super();
|
||||
}
|
||||
|
||||
public AuthorizationException(String arg0, Throwable arg1) {
|
||||
super(arg0, arg1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import org.jasig.cas.authentication.principal.Principal;
|
|||
/**
|
||||
* Simple interface for determining whether a Principal is authorized to use the
|
||||
* application or not.
|
||||
*
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
|
|
@ -19,7 +19,7 @@ public interface CasAuthorizedDecider {
|
|||
|
||||
/**
|
||||
* Determines whether someone can use the system or not.
|
||||
*
|
||||
*
|
||||
* @param principal the person we are checking
|
||||
* @return true if authorized, false otherwise.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -13,26 +13,30 @@ import java.util.List;
|
|||
/**
|
||||
* Default implementation of the CasAuthorizedDecider that delegates to a list
|
||||
* to check if someone is authorized.
|
||||
*
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
*/
|
||||
public final class DefaultCasAuthorizedDeciderImpl implements
|
||||
CasAuthorizedDecider {
|
||||
CasAuthorizedDecider {
|
||||
|
||||
/** The list of users authorized to use the system. */
|
||||
private List users;
|
||||
/**
|
||||
* The list of users authorized to use the system.
|
||||
*/
|
||||
private final List users;
|
||||
|
||||
/**
|
||||
* Constructor that takes the list of acceptable users as its parameters.
|
||||
*
|
||||
* @param users the list of acceptable users.
|
||||
*/
|
||||
public DefaultCasAuthorizedDeciderImpl(final List users) {
|
||||
CommonUtils.assertNotEmpty(users, "users cannot be empty.");
|
||||
this.users = users;
|
||||
}
|
||||
|
||||
public boolean isAuthorizedToUseApplication(final Principal principal) {
|
||||
return this.users.contains(principal.getId());
|
||||
}
|
||||
|
||||
public void init() {
|
||||
CommonUtils.assertNotEmpty(this.users, "users cannot be empty.");
|
||||
}
|
||||
|
||||
public void setUsers(final List users) {
|
||||
this.users = users;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<html>
|
||||
<body>
|
||||
<p>The authorization package contains the interface for a simple
|
||||
abstraction for authorizing users to use an application. It is not a
|
||||
complete role-based or access control authorization system.</p>
|
||||
abstraction for authorizing users to use an application. It is not a
|
||||
complete role-based or access control authorization system.</p>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -5,21 +5,21 @@
|
|||
*/
|
||||
package org.jasig.cas.client.proxy;
|
||||
|
||||
import java.io.IOException;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.jasig.cas.client.util.CommonUtils;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.jasig.cas.client.util.CommonUtils;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Implementation of an HttpServlet that accepts ProxyGrantingTicketIous and
|
||||
* ProxyGrantingTickets and stores them in an implementation of
|
||||
* {@link ProxyGrantingTicketStorage}.
|
||||
*
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
|
|
@ -32,53 +32,61 @@ public abstract class AbstractProxyReceptorServlet extends HttpServlet {
|
|||
*/
|
||||
public static final String CONST_PROXY_GRANTING_TICKET_STORAGE_BEAN_NAME = "proxyGrantingTicketStorage";
|
||||
|
||||
/** Constant representing the ProxyGrantingTicket IOU Request Parameter. */
|
||||
/**
|
||||
* Constant representing the ProxyGrantingTicket IOU Request Parameter.
|
||||
*/
|
||||
private static final String PARAM_PROXY_GRANTING_TICKET_IOU = "pgtIou";
|
||||
|
||||
/** Constant representing the ProxyGrantingTicket Request Parameter. */
|
||||
/**
|
||||
* Constant representing the ProxyGrantingTicket Request Parameter.
|
||||
*/
|
||||
private static final String PARAM_PROXY_GRANTING_TICKET = "pgtId";
|
||||
|
||||
/** Instance of ProxyGrantingTicketStorage to store ProxyGrantingTickets. */
|
||||
/**
|
||||
* Instance of ProxyGrantingTicketStorage to store ProxyGrantingTickets.
|
||||
*/
|
||||
private ProxyGrantingTicketStorage proxyGrantingTicketStorage;
|
||||
|
||||
protected final Log logger = LogFactory.getLog(this.getClass());
|
||||
|
||||
/** Unique Id for Serialization. */
|
||||
/**
|
||||
* Unique Id for Serialization.
|
||||
*/
|
||||
private static final long serialVersionUID = 8766956323018042995L;
|
||||
|
||||
protected final void doGet(final HttpServletRequest request,
|
||||
final HttpServletResponse response) throws ServletException,
|
||||
IOException {
|
||||
final HttpServletResponse response) throws ServletException,
|
||||
IOException {
|
||||
final String proxyGrantingTicketIou = request
|
||||
.getParameter(PARAM_PROXY_GRANTING_TICKET_IOU);
|
||||
.getParameter(PARAM_PROXY_GRANTING_TICKET_IOU);
|
||||
|
||||
final String proxyGrantingTicket = request
|
||||
.getParameter(PARAM_PROXY_GRANTING_TICKET);
|
||||
.getParameter(PARAM_PROXY_GRANTING_TICKET);
|
||||
|
||||
if (CommonUtils.isBlank(proxyGrantingTicket)
|
||||
|| CommonUtils.isBlank(proxyGrantingTicketIou)) {
|
||||
|| CommonUtils.isBlank(proxyGrantingTicketIou)) {
|
||||
response.getWriter().write("");
|
||||
return;
|
||||
}
|
||||
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Received proxyGrantingTicketId ["
|
||||
+ proxyGrantingTicket + "] for proxyGrantingTicketIou ["
|
||||
+ proxyGrantingTicketIou + "]");
|
||||
+ proxyGrantingTicket + "] for proxyGrantingTicketIou ["
|
||||
+ proxyGrantingTicketIou + "]");
|
||||
}
|
||||
|
||||
this.proxyGrantingTicketStorage.save(proxyGrantingTicketIou,
|
||||
proxyGrantingTicket);
|
||||
proxyGrantingTicket);
|
||||
|
||||
response.getWriter().write("<?xml version=\"1.0\"?>");
|
||||
response
|
||||
.getWriter()
|
||||
.write(
|
||||
"<casClient:proxySuccess xmlns:casClient=\"http://www.yale.edu/tp/casClient\" />");
|
||||
.getWriter()
|
||||
.write(
|
||||
"<casClient:proxySuccess xmlns:casClient=\"http://www.yale.edu/tp/casClient\" />");
|
||||
}
|
||||
|
||||
public final void setProxyGrantingTicketStorage(
|
||||
final ProxyGrantingTicketStorage proxyGrantingTicketStorage) {
|
||||
protected final void setProxyGrantingTicketStorage(
|
||||
final ProxyGrantingTicketStorage proxyGrantingTicketStorage) {
|
||||
this.proxyGrantingTicketStorage = proxyGrantingTicketStorage;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,10 +5,6 @@
|
|||
*/
|
||||
package org.jasig.cas.client.proxy;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
|
||||
import org.apache.commons.httpclient.HttpClient;
|
||||
import org.apache.commons.httpclient.methods.GetMethod;
|
||||
import org.apache.commons.logging.Log;
|
||||
|
|
@ -17,35 +13,60 @@ import org.jasig.cas.authentication.principal.Service;
|
|||
import org.jasig.cas.client.util.CommonUtils;
|
||||
import org.jasig.cas.client.util.XmlUtils;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
|
||||
/**
|
||||
* Implementation of a ProxyRetriever that follows the CAS 2.0 specification.
|
||||
* For more information on the CAS 2.0 specification, please see the <a
|
||||
* href="http://www.ja-sig.org/products/cas/overview/protocol/index.html">specification
|
||||
* document</a>.
|
||||
* <p>
|
||||
* <p/>
|
||||
* In general, this class will make a call to the CAS server with some specified
|
||||
* parameters and receive an XML response to parse.
|
||||
*
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
*/
|
||||
public final class Cas20ProxyRetriever implements ProxyRetriever {
|
||||
|
||||
/** Instance of Commons Logging. */
|
||||
protected Log log = LogFactory.getLog(this.getClass());
|
||||
/**
|
||||
* Instance of Commons Logging.
|
||||
*/
|
||||
protected final Log log = LogFactory.getLog(this.getClass());
|
||||
|
||||
/** Url to CAS server. */
|
||||
private String casServerUrl;
|
||||
/**
|
||||
* Url to CAS server.
|
||||
*/
|
||||
private final String casServerUrl;
|
||||
|
||||
/** Instance of HttpClient for connecting to server. */
|
||||
private HttpClient httpClient;
|
||||
/**
|
||||
* Instance of HttpClient for connecting to server.
|
||||
*/
|
||||
private final HttpClient httpClient;
|
||||
|
||||
/**
|
||||
* Main Constructor.
|
||||
*
|
||||
* @param casServerUrl the URL to the CAS server (i.e. http://localhost/cas/)
|
||||
* @param httpClient an Instance of a thread-safe HttpClient.
|
||||
*/
|
||||
public Cas20ProxyRetriever(final String casServerUrl, final HttpClient httpClient) {
|
||||
CommonUtils.assertNotNull(casServerUrl,
|
||||
"casServerUrl cannot be null.");
|
||||
CommonUtils
|
||||
.assertNotNull(httpClient, "httpClient cannot be null.");
|
||||
this.casServerUrl = casServerUrl;
|
||||
this.httpClient = httpClient;
|
||||
}
|
||||
|
||||
public String getProxyTicketIdFor(final String proxyGrantingTicketId,
|
||||
final Service targetService) {
|
||||
final Service targetService) {
|
||||
|
||||
final String url = constructUrl(proxyGrantingTicketId, targetService
|
||||
.getId());
|
||||
.getId());
|
||||
|
||||
final GetMethod method = new GetMethod(url);
|
||||
try {
|
||||
|
|
@ -53,7 +74,7 @@ public final class Cas20ProxyRetriever implements ProxyRetriever {
|
|||
final String response = method.getResponseBodyAsString();
|
||||
|
||||
final String error = XmlUtils.getTextForElement(response,
|
||||
"proxyFailure");
|
||||
"proxyFailure");
|
||||
|
||||
if (CommonUtils.isNotEmpty(error)) {
|
||||
log.debug(error);
|
||||
|
|
@ -71,28 +92,13 @@ public final class Cas20ProxyRetriever implements ProxyRetriever {
|
|||
}
|
||||
|
||||
private String constructUrl(final String proxyGrantingTicketId,
|
||||
final String targetService) {
|
||||
final String targetService) {
|
||||
try {
|
||||
return this.casServerUrl + "proxy" + "?pgt="
|
||||
+ proxyGrantingTicketId + "&targetService="
|
||||
+ URLEncoder.encode(targetService, "UTF-8");
|
||||
+ proxyGrantingTicketId + "&targetService="
|
||||
+ URLEncoder.encode(targetService, "UTF-8");
|
||||
} catch (final UnsupportedEncodingException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void setCasServerUrl(final String casServerUrl) {
|
||||
this.casServerUrl = casServerUrl;
|
||||
}
|
||||
|
||||
public void setHttpClient(final HttpClient httpClient) {
|
||||
this.httpClient = httpClient;
|
||||
}
|
||||
|
||||
public void init() {
|
||||
CommonUtils.assertNotNull(this.casServerUrl,
|
||||
"casServerUrl cannot be null.");
|
||||
CommonUtils
|
||||
.assertNotNull(this.httpClient, "httpClient cannot be null.");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ package org.jasig.cas.client.proxy;
|
|||
/**
|
||||
* Interface for the storage and retrieval of ProxyGrantingTicketIds by mapping
|
||||
* them to a specific ProxyGrantingTicketIou.
|
||||
*
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
|
|
@ -17,9 +17,9 @@ public interface ProxyGrantingTicketStorage {
|
|||
|
||||
/**
|
||||
* Method to save the ProxyGrantingTicket to the backing storage facility.
|
||||
*
|
||||
*
|
||||
* @param proxyGrantingTicketIou used as the key
|
||||
* @param proxyGrantingTicket used as the value
|
||||
* @param proxyGrantingTicket used as the value
|
||||
*/
|
||||
public void save(String proxyGrantingTicketIou, String proxyGrantingTicket);
|
||||
|
||||
|
|
@ -28,7 +28,7 @@ public interface ProxyGrantingTicketStorage {
|
|||
* ProxyGrantingTicketIou. Note that implementations are not guaranteed to
|
||||
* return the same result if retrieve is called twice with the same
|
||||
* proxyGrantingTicketIou.
|
||||
*
|
||||
*
|
||||
* @param proxyGrantingTicketIou used as the key
|
||||
* @return the ProxyGrantingTicket Id or null if it can't be found
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -5,33 +5,47 @@
|
|||
*/
|
||||
package org.jasig.cas.client.proxy;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* Implementation of {@link ProxyGrantingTicketStorage} that is backed by a
|
||||
* HashMap that keeps a ProxyGrantingTicket for a specified amount of time.
|
||||
* <p>
|
||||
* <p/>
|
||||
* A cleanup thread is run periodically to clean out the HashMap.
|
||||
*
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
*/
|
||||
public final class ProxyGrantingTicketStorageImpl implements
|
||||
ProxyGrantingTicketStorage {
|
||||
ProxyGrantingTicketStorage {
|
||||
|
||||
/**
|
||||
* Default timeout in milliseconds.
|
||||
*/
|
||||
private static final long DEFAULT_TIMEOUT = 60000;
|
||||
|
||||
private Map cache = new HashMap();
|
||||
private final Map cache = new HashMap();
|
||||
|
||||
private long timeout = DEFAULT_TIMEOUT;
|
||||
/**
|
||||
* Constructor set the timeout to the default value.
|
||||
*/
|
||||
public ProxyGrantingTicketStorageImpl() {
|
||||
this(DEFAULT_TIMEOUT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the amount of time to hold on to a ProxyGrantingTicket if its never
|
||||
* been retrieved.
|
||||
*
|
||||
* @param timeout the time to hold on to the ProxyGrantingTicket
|
||||
*/
|
||||
public ProxyGrantingTicketStorageImpl(final long timeout) {
|
||||
final Thread thread = new ProxyGrantingTicketCleanupThread(
|
||||
timeout, this.cache);
|
||||
thread.setDaemon(true);
|
||||
thread.start();
|
||||
}
|
||||
|
||||
/**
|
||||
* NOTE: you can only retrieve a ProxyGrantingTicket once with this method.
|
||||
|
|
@ -39,7 +53,7 @@ public final class ProxyGrantingTicketStorageImpl implements
|
|||
*/
|
||||
public String retrieve(final String proxyGrantingTicketIou) {
|
||||
final ProxyGrantingTicketHolder holder = (ProxyGrantingTicketHolder) this.cache
|
||||
.get(proxyGrantingTicketIou);
|
||||
.get(proxyGrantingTicketIou);
|
||||
|
||||
if (holder == null) {
|
||||
return null;
|
||||
|
|
@ -51,31 +65,14 @@ public final class ProxyGrantingTicketStorageImpl implements
|
|||
}
|
||||
|
||||
public void save(final String proxyGrantingTicketIou,
|
||||
final String proxyGrantingTicket) {
|
||||
final String proxyGrantingTicket) {
|
||||
final ProxyGrantingTicketHolder holder = new ProxyGrantingTicketHolder(
|
||||
proxyGrantingTicket);
|
||||
proxyGrantingTicket);
|
||||
|
||||
this.cache.put(proxyGrantingTicketIou, holder);
|
||||
}
|
||||
|
||||
public void init() throws Exception {
|
||||
final Thread thread = new ProxyGrantingTicketCleanupThread(
|
||||
this.timeout, this.cache);
|
||||
thread.setDaemon(true);
|
||||
thread.start();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the amount of time to hold on to a ProxyGrantingTicket if its never
|
||||
* been retrieved.
|
||||
*
|
||||
* @param timeout the time to hold on to the ProxyGrantingTicket
|
||||
*/
|
||||
public void setTimeout(final long timeout) {
|
||||
this.timeout = timeout;
|
||||
}
|
||||
|
||||
private class ProxyGrantingTicketHolder {
|
||||
private final class ProxyGrantingTicketHolder {
|
||||
|
||||
private final String proxyGrantingTicket;
|
||||
|
||||
|
|
@ -95,14 +92,14 @@ public final class ProxyGrantingTicketStorageImpl implements
|
|||
}
|
||||
}
|
||||
|
||||
private class ProxyGrantingTicketCleanupThread extends Thread {
|
||||
private final class ProxyGrantingTicketCleanupThread extends Thread {
|
||||
|
||||
private final long timeout;
|
||||
|
||||
private final Map cache;
|
||||
|
||||
public ProxyGrantingTicketCleanupThread(final long timeout,
|
||||
final Map cache) {
|
||||
final Map cache) {
|
||||
this.timeout = timeout;
|
||||
this.cache = cache;
|
||||
}
|
||||
|
|
@ -120,10 +117,10 @@ public final class ProxyGrantingTicketStorageImpl implements
|
|||
|
||||
synchronized (this.cache) {
|
||||
for (final Iterator iter = this.cache.keySet().iterator(); iter
|
||||
.hasNext();) {
|
||||
.hasNext();) {
|
||||
final Object key = iter.next();
|
||||
final ProxyGrantingTicketHolder holder = (ProxyGrantingTicketHolder) this.cache
|
||||
.get(key);
|
||||
.get(key);
|
||||
|
||||
if (holder.isExpired(this.timeout)) {
|
||||
itemsToRemove.add(key);
|
||||
|
|
@ -131,7 +128,7 @@ public final class ProxyGrantingTicketStorageImpl implements
|
|||
}
|
||||
|
||||
for (final Iterator iter = itemsToRemove.iterator(); iter
|
||||
.hasNext();) {
|
||||
.hasNext();) {
|
||||
this.cache.remove(iter.next());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import org.jasig.cas.authentication.principal.Service;
|
|||
/**
|
||||
* Interface to abstract the retrieval of a proxy ticket to make the
|
||||
* implementation a black box to the client.
|
||||
*
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
|
|
@ -19,11 +19,11 @@ public interface ProxyRetriever {
|
|||
|
||||
/**
|
||||
* Retrieves a proxy ticket for a specific targetService.
|
||||
*
|
||||
*
|
||||
* @param proxyGrantingTicketId the ProxyGrantingTicketId
|
||||
* @param targetService the service we want to proxy.
|
||||
* @param targetService the service we want to proxy.
|
||||
* @return the ProxyTicket Id if Granted, null otherwise.
|
||||
*/
|
||||
String getProxyTicketIdFor(String proxyGrantingTicketId,
|
||||
Service targetService);
|
||||
Service targetService);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,49 +5,50 @@
|
|||
*/
|
||||
package org.jasig.cas.client.proxy;
|
||||
|
||||
import java.util.Map;
|
||||
import org.springframework.web.context.WebApplicationContext;
|
||||
import org.springframework.web.context.support.WebApplicationContextUtils;
|
||||
|
||||
import javax.servlet.ServletConfig;
|
||||
import javax.servlet.ServletException;
|
||||
|
||||
import org.springframework.web.context.WebApplicationContext;
|
||||
import org.springframework.web.context.support.WebApplicationContextUtils;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Implementation of an HttpServlet that accepts ProxyGrantingTicketIous and
|
||||
* ProxyGrantingTickets and stores them in an implementation of
|
||||
* {@link ProxyGrantingTicketStorage}.
|
||||
* <p>
|
||||
* <p/>
|
||||
* Note that <code>ProxyReceptorServlet</code> attempts to load a
|
||||
* {@link ProxyGrantingTicketStorage} from the ApplicationContext either via the
|
||||
* name "proxyGrantingTicketStorage" or by type. One of these two must exist
|
||||
* within the applicationContext or the initialization of the
|
||||
* ProxyReceptorServlet will fail.
|
||||
*
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
*/
|
||||
public final class SpringConfiguredProxyReceptorServlet extends
|
||||
AbstractProxyReceptorServlet {
|
||||
AbstractProxyReceptorServlet {
|
||||
|
||||
/** Unique Id for serialization */
|
||||
/**
|
||||
* Unique Id for serialization
|
||||
*/
|
||||
private static final long serialVersionUID = -5642050740265266568L;
|
||||
|
||||
public void init(final ServletConfig servletConfig) throws ServletException {
|
||||
final WebApplicationContext context = WebApplicationContextUtils
|
||||
.getRequiredWebApplicationContext(servletConfig.getServletContext());
|
||||
.getRequiredWebApplicationContext(servletConfig.getServletContext());
|
||||
|
||||
if (context.containsBean(CONST_PROXY_GRANTING_TICKET_STORAGE_BEAN_NAME)) {
|
||||
this
|
||||
.setProxyGrantingTicketStorage((ProxyGrantingTicketStorage) context
|
||||
.getBean(CONST_PROXY_GRANTING_TICKET_STORAGE_BEAN_NAME,
|
||||
ProxyGrantingTicketStorage.class));
|
||||
.setProxyGrantingTicketStorage((ProxyGrantingTicketStorage) context
|
||||
.getBean(CONST_PROXY_GRANTING_TICKET_STORAGE_BEAN_NAME,
|
||||
ProxyGrantingTicketStorage.class));
|
||||
return;
|
||||
}
|
||||
|
||||
final Map map = context
|
||||
.getBeansOfType(ProxyGrantingTicketStorage.class);
|
||||
.getBeansOfType(ProxyGrantingTicketStorage.class);
|
||||
|
||||
if (map.isEmpty()) {
|
||||
throw new ServletException("No ProxyGrantingTicketStorage found!");
|
||||
|
|
@ -55,11 +56,11 @@ public final class SpringConfiguredProxyReceptorServlet extends
|
|||
|
||||
if (map.size() > 1) {
|
||||
throw new ServletException(
|
||||
"Expecting one ProxyGrantingTicketStorage and found multiple instances.");
|
||||
"Expecting one ProxyGrantingTicketStorage and found multiple instances.");
|
||||
}
|
||||
|
||||
setProxyGrantingTicketStorage((ProxyGrantingTicketStorage) map.get(map
|
||||
.keySet().iterator().next()));
|
||||
.keySet().iterator().next()));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<html>
|
||||
<body>
|
||||
<p>The proxy package includes a servlet to act as a proxy receptor,
|
||||
an interface for ProxyGrantingTicketStorage and an abstraction for
|
||||
retrieving proxy tickets.</p>
|
||||
an interface for ProxyGrantingTicketStorage and an abstraction for
|
||||
retrieving proxy tickets.</p>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -9,7 +9,7 @@ import java.util.Collection;
|
|||
|
||||
/**
|
||||
* Common utilities so that we don't need to include Commons Lang.
|
||||
*
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
|
|
@ -23,8 +23,8 @@ public final class CommonUtils {
|
|||
/**
|
||||
* Check whether the object is null or not. If it is, throw an exception and
|
||||
* display the message.
|
||||
*
|
||||
* @param object the object to check.
|
||||
*
|
||||
* @param object the object to check.
|
||||
* @param message the message to display if the object is null.
|
||||
*/
|
||||
public static void assertNotNull(final Object object, final String message) {
|
||||
|
|
@ -36,8 +36,8 @@ public final class CommonUtils {
|
|||
/**
|
||||
* Check whether the collection is null or empty. If it is, throw an
|
||||
* exception and display the message.
|
||||
*
|
||||
* @param c the collecion to check.
|
||||
*
|
||||
* @param c the collecion to check.
|
||||
* @param message the message to display if the object is null.
|
||||
*/
|
||||
public static void assertNotEmpty(final Collection c, final String message) {
|
||||
|
|
@ -50,8 +50,8 @@ public final class CommonUtils {
|
|||
/**
|
||||
* Assert that the statement is true, otherwise throw an exception with the
|
||||
* provided message.
|
||||
*
|
||||
* @param cond the codition to assert is true.
|
||||
*
|
||||
* @param cond the codition to assert is true.
|
||||
* @param message the message to display if the condition is not true.
|
||||
*/
|
||||
public static void assertTrue(final boolean cond, final String message) {
|
||||
|
|
@ -62,7 +62,7 @@ public final class CommonUtils {
|
|||
|
||||
/**
|
||||
* Determines whether the String is null or of length 0.
|
||||
*
|
||||
*
|
||||
* @param string the string to check
|
||||
* @return true if its null or length of 0, false otherwise.
|
||||
*/
|
||||
|
|
@ -73,7 +73,7 @@ public final class CommonUtils {
|
|||
/**
|
||||
* Determines if the String is not empty. A string is not empty if it is not
|
||||
* null and has a length > 0.
|
||||
*
|
||||
*
|
||||
* @param string the string to check
|
||||
* @return true if it is not empty, false otherwise.
|
||||
*/
|
||||
|
|
@ -84,7 +84,7 @@ public final class CommonUtils {
|
|||
/**
|
||||
* Determines if a String is blank or not. A String is blank if its empty or
|
||||
* if it only contains spaces.
|
||||
*
|
||||
*
|
||||
* @param string the string to check
|
||||
* @return true if its blank, false otherwise.
|
||||
*/
|
||||
|
|
@ -95,7 +95,7 @@ public final class CommonUtils {
|
|||
/**
|
||||
* Determines if a string is not blank. A string is not blank if it contains
|
||||
* at least one non-whitespace character.
|
||||
*
|
||||
*
|
||||
* @param string the string to check.
|
||||
* @return true if its not blank, false otherwise.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ import org.apache.commons.logging.LogFactory;
|
|||
|
||||
import javax.servlet.*;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
|
|
@ -18,55 +17,89 @@ import java.util.Map;
|
|||
* A Delegating Filter looks up a parameter in the request object and matches
|
||||
* (either exact or using Regular Expressions) the value. If there is a match,
|
||||
* the associated filter is executed. Otherwise, the normal chain is executed.
|
||||
*
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
*/
|
||||
public final class DelegatingFilter implements Filter {
|
||||
|
||||
/** Instance of Commons Logging. */
|
||||
private Log log = LogFactory.getLog(this.getClass());
|
||||
/**
|
||||
* Instance of Commons Logging.
|
||||
*/
|
||||
private final Log log = LogFactory.getLog(this.getClass());
|
||||
|
||||
/** The request parameter to look for in the Request object. */
|
||||
private String requestParameterName;
|
||||
/**
|
||||
* The request parameter to look for in the Request object.
|
||||
*/
|
||||
private final String requestParameterName;
|
||||
|
||||
/** The map of filters to delegate to and the criteria (as key). */
|
||||
private Map delegators = new HashMap();
|
||||
/**
|
||||
* The map of filters to delegate to and the criteria (as key).
|
||||
*/
|
||||
private final Map delegators;
|
||||
|
||||
/** The default filter to use if there is no match. */
|
||||
private Filter defaultFilter;
|
||||
/**
|
||||
* The default filter to use if there is no match.
|
||||
*/
|
||||
private final Filter defaultFilter;
|
||||
|
||||
/**
|
||||
* Whether the key in the delegators map is an exact match or a regular
|
||||
* expression.
|
||||
*/
|
||||
private boolean exactMatch = false;
|
||||
private final boolean exactMatch;
|
||||
|
||||
public DelegatingFilter(final String requestParameterName, final Map delegators, final boolean exactMatch) {
|
||||
this(requestParameterName, delegators, exactMatch, null);
|
||||
}
|
||||
|
||||
public DelegatingFilter(final String requestParameterName, final Map delegators, final boolean exactMatch, final Filter defaultFilter) {
|
||||
CommonUtils.assertNotNull(requestParameterName,
|
||||
"requestParameterName cannot be null.");
|
||||
CommonUtils.assertTrue(!delegators.isEmpty(),
|
||||
"delegators cannot be empty.");
|
||||
|
||||
for (final Iterator iter = delegators.keySet().iterator(); iter
|
||||
.hasNext();) {
|
||||
final Object object = delegators.get(iter.next());
|
||||
|
||||
if (!Filter.class.isAssignableFrom(object.getClass())) {
|
||||
throw new IllegalArgumentException(
|
||||
"All value objects in the delegators map must be filters.");
|
||||
}
|
||||
}
|
||||
|
||||
this.requestParameterName = requestParameterName;
|
||||
this.delegators = delegators;
|
||||
this.defaultFilter = defaultFilter;
|
||||
this.exactMatch = exactMatch;
|
||||
}
|
||||
|
||||
public void destroy() {
|
||||
// nothing to do here
|
||||
}
|
||||
|
||||
public void doFilter(final ServletRequest request,
|
||||
final ServletResponse response, final FilterChain filterChain)
|
||||
throws IOException, ServletException {
|
||||
final ServletResponse response, final FilterChain filterChain)
|
||||
throws IOException, ServletException {
|
||||
|
||||
final String parameter = request
|
||||
.getParameter(this.requestParameterName);
|
||||
.getParameter(this.requestParameterName);
|
||||
|
||||
if (CommonUtils.isNotEmpty(parameter)) {
|
||||
for (final Iterator iter = this.delegators.keySet().iterator(); iter
|
||||
.hasNext();) {
|
||||
.hasNext();) {
|
||||
final String key = (String) iter.next();
|
||||
|
||||
if ((parameter.equals(key) && this.exactMatch)
|
||||
|| (parameter.matches(key) && !this.exactMatch)) {
|
||||
|| (parameter.matches(key) && !this.exactMatch)) {
|
||||
final Filter filter = (Filter) this.delegators.get(key);
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Match found for parameter ["
|
||||
+ this.requestParameterName + "] with value ["
|
||||
+ parameter + "]. Delegating to filter ["
|
||||
+ filter.getClass().getName() + "]");
|
||||
+ this.requestParameterName + "] with value ["
|
||||
+ parameter + "]. Delegating to filter ["
|
||||
+ filter.getClass().getName() + "]");
|
||||
}
|
||||
filter.doFilter(request, response, filterChain);
|
||||
return;
|
||||
|
|
@ -75,7 +108,7 @@ public final class DelegatingFilter implements Filter {
|
|||
}
|
||||
|
||||
log.debug("No match found for parameter [" + this.requestParameterName
|
||||
+ "] with value [" + parameter + "]");
|
||||
+ "] with value [" + parameter + "]");
|
||||
|
||||
if (this.defaultFilter != null) {
|
||||
this.defaultFilter.doFilter(request, response, filterChain);
|
||||
|
|
@ -87,59 +120,4 @@ public final class DelegatingFilter implements Filter {
|
|||
public void init(final FilterConfig filterConfig) throws ServletException {
|
||||
// nothing to do here.
|
||||
}
|
||||
|
||||
public void init() {
|
||||
CommonUtils.assertNotNull(this.requestParameterName,
|
||||
"requestParameterName cannot be null.");
|
||||
CommonUtils.assertTrue(!this.delegators.isEmpty(),
|
||||
"delegators cannot be empty.");
|
||||
|
||||
for (final Iterator iter = this.delegators.keySet().iterator(); iter
|
||||
.hasNext();) {
|
||||
final Object object = this.delegators.get(iter.next());
|
||||
|
||||
if (!Filter.class.isAssignableFrom(object.getClass())) {
|
||||
throw new IllegalArgumentException(
|
||||
"All value objects in the delegators map must be filters.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the map of delegating filters.
|
||||
*
|
||||
* @param delegators the map of delegators to set.
|
||||
*/
|
||||
public void setDelegators(final Map delegators) {
|
||||
this.delegators = delegators;
|
||||
}
|
||||
|
||||
/**
|
||||
* Marks whether the value of the parameter needs to match exactly or not.
|
||||
*
|
||||
* @param exactMatch the value of whether we need to match exactly or not.
|
||||
*/
|
||||
public void setExactMatch(final boolean exactMatch) {
|
||||
this.exactMatch = exactMatch;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the name of the request parameter to monitor.
|
||||
*
|
||||
* @param requestParameterName the name of the request parameter.
|
||||
*/
|
||||
public void setRequestParameterName(final String requestParameterName) {
|
||||
this.requestParameterName = requestParameterName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the default filter to use if there are no matches. This is optional
|
||||
* as the filter will just continue on the chain if there is no default.
|
||||
*
|
||||
* @param defaultFilter the filter to use by default.
|
||||
*/
|
||||
protected void setDefaultFilter(final Filter defaultFilter) {
|
||||
this.defaultFilter = defaultFilter;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@
|
|||
*/
|
||||
package org.jasig.cas.client.util;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.web.context.support.WebApplicationContextUtils;
|
||||
|
||||
|
|
@ -14,52 +16,55 @@ import java.io.IOException;
|
|||
/**
|
||||
* Utility class to retrieve a Filter from a Spring-managed configuration file.
|
||||
* Based on the FilterToBeanProxy class in Acegi Security (but simplified)
|
||||
*
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
*/
|
||||
public class FilterToBeanProxy implements Filter {
|
||||
|
||||
/** The filter we are proxying. */
|
||||
/**
|
||||
* The filter we are proxying.
|
||||
*/
|
||||
private Filter filter;
|
||||
|
||||
public void destroy() {
|
||||
/**
|
||||
* Instance of commons logging.
|
||||
*/
|
||||
protected final Log log = LogFactory.getLog(this.getClass());
|
||||
|
||||
public final void destroy() {
|
||||
// nothing to do
|
||||
}
|
||||
|
||||
public final void doFilter(final ServletRequest request,
|
||||
final ServletResponse response, final FilterChain chain)
|
||||
throws IOException, ServletException {
|
||||
final ServletResponse response, final FilterChain chain)
|
||||
throws IOException, ServletException {
|
||||
this.filter.doFilter(request, response, chain);
|
||||
}
|
||||
|
||||
public final void init(final FilterConfig filterConfig)
|
||||
throws ServletException {
|
||||
doInit(filterConfig);
|
||||
}
|
||||
|
||||
protected ApplicationContext getContext(FilterConfig filterConfig) {
|
||||
return WebApplicationContextUtils
|
||||
.getRequiredWebApplicationContext(filterConfig.getServletContext());
|
||||
}
|
||||
|
||||
public final void doInit(final FilterConfig filterConfig)
|
||||
throws ServletException {
|
||||
throws ServletException {
|
||||
final String targetBean = filterConfig.getInitParameter("targetBean");
|
||||
|
||||
if (CommonUtils.isBlank(targetBean)) {
|
||||
throw new ServletException(
|
||||
"init-parameter missing: targetBean is required.");
|
||||
"init-parameter missing: targetBean is required.");
|
||||
}
|
||||
|
||||
final ApplicationContext ctx = this.getContext(filterConfig);
|
||||
|
||||
if (!ctx.containsBean(targetBean)) {
|
||||
throw new ServletException("targetBean '" + targetBean
|
||||
+ "' not found in context");
|
||||
+ "' not found in context");
|
||||
}
|
||||
|
||||
log.trace("Loading filter from Spring ApplicationContext with name: " + targetBean);
|
||||
this.filter = (Filter) ctx.getBean(targetBean, Filter.class);
|
||||
}
|
||||
|
||||
protected ApplicationContext getContext(FilterConfig filterConfig) {
|
||||
return WebApplicationContextUtils
|
||||
.getRequiredWebApplicationContext(filterConfig.getServletContext());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,10 +5,6 @@
|
|||
*/
|
||||
package org.jasig.cas.client.util;
|
||||
|
||||
import java.io.StringReader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.xml.sax.Attributes;
|
||||
|
|
@ -18,21 +14,27 @@ import org.xml.sax.XMLReader;
|
|||
import org.xml.sax.helpers.DefaultHandler;
|
||||
import org.xml.sax.helpers.XMLReaderFactory;
|
||||
|
||||
import java.io.StringReader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Common utilities for easily parsing XML without duplicating logic.
|
||||
*
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
*/
|
||||
public final class XmlUtils {
|
||||
|
||||
/** Static instance of Commons Logging. */
|
||||
/**
|
||||
* Static instance of Commons Logging.
|
||||
*/
|
||||
private final static Log LOG = LogFactory.getLog(XmlUtils.class);
|
||||
|
||||
/**
|
||||
* Get an instance of an XML reader from the XMLReaderFactory.
|
||||
*
|
||||
*
|
||||
* @return the XMLReader.
|
||||
*/
|
||||
public static XMLReader getXmlReader() {
|
||||
|
|
@ -46,32 +48,33 @@ public final class XmlUtils {
|
|||
/**
|
||||
* Retrieve the text for a group of elements. Each text element is an entry
|
||||
* in a list.
|
||||
*
|
||||
*
|
||||
* @param xmlAsString the xml response
|
||||
* @param element the element to look for
|
||||
* @param element the element to look for
|
||||
* @return the list of text from the elements.
|
||||
*/
|
||||
public static List getTextForElements(final String xmlAsString,
|
||||
final String element) {
|
||||
final List elements = new ArrayList();
|
||||
final String element) {
|
||||
// XXX: optimized to 2, as most proxy chains have a length of no more than two
|
||||
final List elements = new ArrayList(2);
|
||||
final XMLReader reader = getXmlReader();
|
||||
|
||||
final DefaultHandler handler = new DefaultHandler(){
|
||||
final DefaultHandler handler = new DefaultHandler() {
|
||||
|
||||
private boolean foundElement = false;
|
||||
|
||||
private StringBuffer buffer = new StringBuffer();
|
||||
|
||||
public void startElement(final String uri, final String localName,
|
||||
final String qName, final Attributes attributes)
|
||||
throws SAXException {
|
||||
final String qName, final Attributes attributes)
|
||||
throws SAXException {
|
||||
if (localName.equals(element)) {
|
||||
this.foundElement = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void endElement(final String uri, final String localName,
|
||||
final String qName) throws SAXException {
|
||||
final String qName) throws SAXException {
|
||||
if (localName.equals(element)) {
|
||||
this.foundElement = false;
|
||||
elements.add(this.buffer.toString());
|
||||
|
|
@ -80,7 +83,7 @@ public final class XmlUtils {
|
|||
}
|
||||
|
||||
public void characters(char[] ch, int start, int length)
|
||||
throws SAXException {
|
||||
throws SAXException {
|
||||
if (this.foundElement) {
|
||||
this.buffer.append(ch, start, length);
|
||||
}
|
||||
|
|
@ -103,37 +106,37 @@ public final class XmlUtils {
|
|||
/**
|
||||
* Retrieve the text for a specific element (when we know there is only
|
||||
* one).
|
||||
*
|
||||
*
|
||||
* @param xmlAsString the xml response
|
||||
* @param element the element to look for
|
||||
* @param element the element to look for
|
||||
* @return the text value of the element.
|
||||
*/
|
||||
public static String getTextForElement(final String xmlAsString,
|
||||
final String element) {
|
||||
final String element) {
|
||||
final XMLReader reader = getXmlReader();
|
||||
final StringBuffer buffer = new StringBuffer();
|
||||
|
||||
final DefaultHandler handler = new DefaultHandler(){
|
||||
final DefaultHandler handler = new DefaultHandler() {
|
||||
|
||||
private boolean foundElement = false;
|
||||
|
||||
public void startElement(final String uri, final String localName,
|
||||
final String qName, final Attributes attributes)
|
||||
throws SAXException {
|
||||
final String qName, final Attributes attributes)
|
||||
throws SAXException {
|
||||
if (localName.equals(element)) {
|
||||
this.foundElement = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void endElement(final String uri, final String localName,
|
||||
final String qName) throws SAXException {
|
||||
final String qName) throws SAXException {
|
||||
if (localName.equals(element)) {
|
||||
this.foundElement = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void characters(char[] ch, int start, int length)
|
||||
throws SAXException {
|
||||
throws SAXException {
|
||||
if (this.foundElement) {
|
||||
buffer.append(ch, start, length);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,28 +12,36 @@ import java.net.URLEncoder;
|
|||
/**
|
||||
* Abstract class for validating tickets that defines a workflow that all ticket
|
||||
* validation should follow.
|
||||
*
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
*/
|
||||
public abstract class AbstractUrlBasedTicketValidator implements
|
||||
TicketValidator {
|
||||
TicketValidator {
|
||||
|
||||
/** Instance of Commons Logging. */
|
||||
protected Log log = LogFactory.getLog(this.getClass());
|
||||
/**
|
||||
* Instance of Commons Logging.
|
||||
*/
|
||||
protected final Log log = LogFactory.getLog(this.getClass());
|
||||
|
||||
/** Url to CAS server. */
|
||||
private String casServerUrl;
|
||||
/**
|
||||
* Url to CAS server.
|
||||
*/
|
||||
private final String casServerUrl;
|
||||
|
||||
/** Whether this client is looking for an authentication from renew. */
|
||||
private boolean renew;
|
||||
/**
|
||||
* Whether this client is looking for an authentication from renew.
|
||||
*/
|
||||
private final boolean renew;
|
||||
|
||||
/** Instance of HttpClient for connecting to server. */
|
||||
private HttpClient httpClient;
|
||||
/**
|
||||
* Instance of HttpClient for connecting to server.
|
||||
*/
|
||||
private final HttpClient httpClient;
|
||||
|
||||
public final Assertion validate(final String ticketId, final Service service)
|
||||
throws ValidationException {
|
||||
throws ValidationException {
|
||||
final String url = constructURL(ticketId, service);
|
||||
final String response = getResponseFromURL(url);
|
||||
|
||||
|
|
@ -41,13 +49,13 @@ public abstract class AbstractUrlBasedTicketValidator implements
|
|||
}
|
||||
|
||||
protected abstract String constructURL(final String ticketId,
|
||||
final Service service);
|
||||
final Service service);
|
||||
|
||||
protected abstract Assertion parseResponse(final String response)
|
||||
throws ValidationException;
|
||||
throws ValidationException;
|
||||
|
||||
private String getResponseFromURL(final String url)
|
||||
throws ValidationException {
|
||||
throws ValidationException {
|
||||
final GetMethod method = new GetMethod(url);
|
||||
|
||||
try {
|
||||
|
|
@ -56,24 +64,25 @@ public abstract class AbstractUrlBasedTicketValidator implements
|
|||
} catch (Exception e) {
|
||||
log.error(e, e);
|
||||
throw new ValidationException(
|
||||
"Unable to retrieve response from CAS Server.", e);
|
||||
"Unable to retrieve response from CAS Server.", e);
|
||||
} finally {
|
||||
method.releaseConnection();
|
||||
}
|
||||
}
|
||||
|
||||
public final void init() {
|
||||
CommonUtils.assertNotNull(this.casServerUrl,
|
||||
"the validationUrl cannot be null");
|
||||
protected AbstractUrlBasedTicketValidator(final String casServerUrl, final boolean renew, final HttpClient httpClient) {
|
||||
CommonUtils.assertNotNull(casServerUrl,
|
||||
"the validationUrl cannot be null");
|
||||
CommonUtils
|
||||
.assertNotNull(this.httpClient, "httpClient cannot be null.");
|
||||
|
||||
afterPropertiesSetInternal();
|
||||
.assertNotNull(httpClient, "httpClient cannot be null.");
|
||||
this.casServerUrl = casServerUrl;
|
||||
this.renew = renew;
|
||||
this.httpClient = httpClient;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to encode the service url.
|
||||
*
|
||||
*
|
||||
* @param service the service url to encode.
|
||||
* @return the encoded service url.
|
||||
*/
|
||||
|
|
@ -92,26 +101,4 @@ public abstract class AbstractUrlBasedTicketValidator implements
|
|||
protected final boolean isRenew() {
|
||||
return this.renew;
|
||||
}
|
||||
|
||||
public final void setCasServerUrl(final String casServerUrl) {
|
||||
this.casServerUrl = casServerUrl;
|
||||
}
|
||||
|
||||
public final void setHttpClient(final HttpClient httpClient) {
|
||||
this.httpClient = httpClient;
|
||||
}
|
||||
|
||||
public final void setRenew(final boolean renew) {
|
||||
this.renew = renew;
|
||||
}
|
||||
|
||||
/**
|
||||
* Template method for afterProperties() for subclasses to call.
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
protected void afterPropertiesSetInternal() {
|
||||
// template method
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,14 +5,14 @@
|
|||
*/
|
||||
package org.jasig.cas.client.validation;
|
||||
|
||||
import org.jasig.cas.authentication.principal.Principal;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
|
||||
import org.jasig.cas.authentication.principal.Principal;
|
||||
|
||||
/**
|
||||
* Interface to represent a successful response from the CAS Server.
|
||||
*
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
|
|
@ -21,7 +21,7 @@ public interface Assertion extends Serializable {
|
|||
|
||||
/**
|
||||
* Method to retrieve the principal.
|
||||
*
|
||||
*
|
||||
* @return the principal.
|
||||
*/
|
||||
Principal getPrincipal();
|
||||
|
|
@ -30,14 +30,14 @@ public interface Assertion extends Serializable {
|
|||
* Map of attributes returned by the CAS server. A client must know what
|
||||
* attributes he is looking for as CAS makes no claims about what attributes
|
||||
* are returned.
|
||||
*
|
||||
*
|
||||
* @return the map of attributes.
|
||||
*/
|
||||
Map getAttributes();
|
||||
|
||||
/**
|
||||
* Method to retrieve the proxyGrantingTicket Id.
|
||||
*
|
||||
*
|
||||
* @return the ProxyGrantingTicket Id if one exists, otherwise null.
|
||||
*/
|
||||
String getProxyGrantingTicketId();
|
||||
|
|
|
|||
|
|
@ -13,14 +13,16 @@ import java.util.Map;
|
|||
|
||||
/**
|
||||
* Concrete implementation of an Assertion.
|
||||
*
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
*/
|
||||
public class AssertionImpl implements Assertion {
|
||||
|
||||
/** Unique id for serialization. */
|
||||
/**
|
||||
* Unique id for serialization.
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
|
|
@ -29,10 +31,14 @@ public class AssertionImpl implements Assertion {
|
|||
*/
|
||||
private final Map attributes;
|
||||
|
||||
/** The principal who was authenticated. */
|
||||
/**
|
||||
* The principal who was authenticated.
|
||||
*/
|
||||
private final Principal principal;
|
||||
|
||||
/** The Proxy Granting Ticket Id returned by the server. */
|
||||
/**
|
||||
* The Proxy Granting Ticket Id returned by the server.
|
||||
*/
|
||||
private final String proxyGrantingTicketId;
|
||||
|
||||
public AssertionImpl(final Principal principal) {
|
||||
|
|
@ -40,24 +46,24 @@ public class AssertionImpl implements Assertion {
|
|||
}
|
||||
|
||||
public AssertionImpl(final Principal principal, final Map attributes,
|
||||
final String proxyGrantingTicketId) {
|
||||
final String proxyGrantingTicketId) {
|
||||
CommonUtils.assertNotNull(principal, "principal cannot be null");
|
||||
|
||||
this.principal = principal;
|
||||
this.attributes = attributes == null ? new HashMap() : attributes;
|
||||
this.proxyGrantingTicketId = CommonUtils
|
||||
.isNotEmpty(proxyGrantingTicketId) ? proxyGrantingTicketId : null;
|
||||
.isNotEmpty(proxyGrantingTicketId) ? proxyGrantingTicketId : null;
|
||||
}
|
||||
|
||||
public Map getAttributes() {
|
||||
public final Map getAttributes() {
|
||||
return this.attributes;
|
||||
}
|
||||
|
||||
public Principal getPrincipal() {
|
||||
public final Principal getPrincipal() {
|
||||
return this.principal;
|
||||
}
|
||||
|
||||
public String getProxyGrantingTicketId() {
|
||||
public final String getProxyGrantingTicketId() {
|
||||
return this.proxyGrantingTicketId;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,40 +5,45 @@
|
|||
*/
|
||||
package org.jasig.cas.client.validation;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.StringReader;
|
||||
|
||||
import org.apache.commons.httpclient.HttpClient;
|
||||
import org.jasig.cas.authentication.principal.Principal;
|
||||
import org.jasig.cas.authentication.principal.Service;
|
||||
import org.jasig.cas.authentication.principal.SimplePrincipal;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.StringReader;
|
||||
|
||||
/**
|
||||
* Implementation of TicketValidator that follows the CAS 1.0 protocol.
|
||||
*
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
*/
|
||||
public class Cas10TicketValidator extends AbstractUrlBasedTicketValidator {
|
||||
public final class Cas10TicketValidator extends AbstractUrlBasedTicketValidator {
|
||||
|
||||
public Cas10TicketValidator(final String casServerUrl, final boolean renew, final HttpClient httpClient) {
|
||||
super(casServerUrl, renew, httpClient);
|
||||
}
|
||||
|
||||
protected String constructURL(final String ticketId, final Service service) {
|
||||
return getCasServerUrl() + "validate?ticket=" + ticketId
|
||||
+ (isRenew() ? "&renew=true" : "") + "&service="
|
||||
+ getEncodedService(service);
|
||||
+ (isRenew() ? "&renew=true" : "") + "&service="
|
||||
+ getEncodedService(service);
|
||||
}
|
||||
|
||||
protected final Assertion parseResponse(final String response)
|
||||
throws ValidationException {
|
||||
throws ValidationException {
|
||||
if (response == null || "no\n\n".equals(response)
|
||||
|| !response.startsWith("yes")) {
|
||||
|| !response.startsWith("yes")) {
|
||||
throw new ValidationException(
|
||||
"'No' response returned from server for validation request.");
|
||||
"'No' response returned from server for validation request.");
|
||||
}
|
||||
|
||||
try {
|
||||
final BufferedReader reader = new BufferedReader(new StringReader(
|
||||
response));
|
||||
response));
|
||||
reader.readLine();
|
||||
|
||||
final Principal principal = new SimplePrincipal(reader.readLine());
|
||||
|
|
|
|||
|
|
@ -5,20 +5,27 @@
|
|||
*/
|
||||
package org.jasig.cas.client.validation;
|
||||
|
||||
import org.apache.commons.httpclient.HttpClient;
|
||||
import org.jasig.cas.authentication.principal.Service;
|
||||
import org.jasig.cas.authentication.principal.SimpleService;
|
||||
import org.jasig.cas.client.proxy.ProxyGrantingTicketStorage;
|
||||
import org.jasig.cas.client.util.CommonUtils;
|
||||
import org.jasig.cas.client.util.XmlUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.jasig.cas.authentication.principal.Service;
|
||||
import org.jasig.cas.authentication.principal.SimpleService;
|
||||
import org.jasig.cas.client.util.CommonUtils;
|
||||
import org.jasig.cas.client.util.XmlUtils;
|
||||
|
||||
/**
|
||||
* Implementation of the TicketValidator interface that knows how to handle
|
||||
* proxy tickets.
|
||||
*
|
||||
* <p/>
|
||||
* In your XML configuration file, proxy chains should be defined as
|
||||
* follows: <list> <value> proxy1 proxy2 proxy3</value>
|
||||
* <value> proxy2 proxy4 proxy5</value> <value> proxy4
|
||||
* proxy5 proxy6</value> </list>
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
|
|
@ -26,17 +33,58 @@ import org.jasig.cas.client.util.XmlUtils;
|
|||
public class Cas20ProxyTicketValidator extends Cas20ServiceTicketValidator {
|
||||
|
||||
/* List of proxy chains that we accept. */
|
||||
private List proxyChains;
|
||||
private final List proxyChains;
|
||||
|
||||
/** Boolean whether we accept any proxy request or not. */
|
||||
private boolean acceptAnyProxy;
|
||||
/**
|
||||
* Boolean whether we accept any proxy request or not.
|
||||
*/
|
||||
private final boolean acceptAnyProxy;
|
||||
|
||||
/**
|
||||
* @param casServerUrl the url to the CAS server, minus the endpoint.
|
||||
* @param renew flag for whether we require authentication to be via an initial authentication.
|
||||
* @param httpClient an instance of HttpClient to do the calls.
|
||||
* @param proxyGrantingTicketStorage a reference to the storage of the proxy tickets.
|
||||
* @param proxyChains the chains of proxy lists that we accept tickets from.
|
||||
* @param acceptAnyProxy flag on whether we accept any proxy or not.
|
||||
*/
|
||||
public Cas20ProxyTicketValidator(final String casServerUrl, final boolean renew, final HttpClient httpClient, final ProxyGrantingTicketStorage proxyGrantingTicketStorage, List proxyChains, boolean acceptAnyProxy) {
|
||||
this(casServerUrl, renew, httpClient, null, proxyGrantingTicketStorage, proxyChains, acceptAnyProxy);
|
||||
}
|
||||
|
||||
public Cas20ProxyTicketValidator(final String casServerUrl, final boolean renew, final HttpClient httpClient, final Service proxyCallbackUrl, final ProxyGrantingTicketStorage proxyGrantingTicketStorage, List proxyChains, boolean acceptAnyProxy) {
|
||||
super(casServerUrl, renew, httpClient, proxyCallbackUrl, proxyGrantingTicketStorage);
|
||||
|
||||
CommonUtils.assertTrue(proxyChains != null || acceptAnyProxy,
|
||||
"proxyChains cannot be null or acceptAnyProxy must be true.");
|
||||
CommonUtils.assertTrue((proxyChains != null && !proxyChains
|
||||
.isEmpty())
|
||||
|| acceptAnyProxy,
|
||||
"proxyChains cannot be empty or acceptAnyProxy must be true.");
|
||||
|
||||
// assume each proxy chain has a length of 2
|
||||
final List tempProxyChains = new ArrayList(proxyChains.size() * 2);
|
||||
for (final Iterator iter = proxyChains.iterator(); iter.hasNext();) {
|
||||
final String[] values = ((String) iter.next()).split(" ");
|
||||
final Service[] principals = new Service[values.length];
|
||||
|
||||
for (int i = 0; i < principals.length; i++) {
|
||||
principals[i] = new SimpleService(values[i]);
|
||||
}
|
||||
|
||||
tempProxyChains.add(principals);
|
||||
}
|
||||
|
||||
this.proxyChains = tempProxyChains;
|
||||
this.acceptAnyProxy = acceptAnyProxy;
|
||||
}
|
||||
|
||||
protected String getValidationUrlName() {
|
||||
return "proxyValidate";
|
||||
}
|
||||
|
||||
protected Assertion getValidAssertionInternal(final String response,
|
||||
final Assertion assertion) throws ValidationException {
|
||||
final Assertion assertion) throws ValidationException {
|
||||
final List proxies = XmlUtils.getTextForElements(response, "proxy");
|
||||
final Service[] principals = new Service[proxies.size()];
|
||||
|
||||
|
|
@ -63,53 +111,6 @@ public class Cas20ProxyTicketValidator extends Cas20ServiceTicketValidator {
|
|||
}
|
||||
|
||||
return new AssertionImpl(assertion.getPrincipal(), assertion
|
||||
.getAttributes(), assertion.getProxyGrantingTicketId());
|
||||
}
|
||||
|
||||
/**
|
||||
* In your XML configuration file, proxy chains should be defined as
|
||||
* follows: <list> <value> proxy1 proxy2 proxy3</value>
|
||||
* <value> proxy2 proxy4 proxy5</value> <value> proxy4
|
||||
* proxy5 proxy6</value> </list>
|
||||
*
|
||||
* @param proxyChains
|
||||
*/
|
||||
public final void setProxyChains(final List proxyChains) {
|
||||
this.proxyChains = proxyChains;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set this flag to true if you don't care where the proxied request came
|
||||
* from.
|
||||
*
|
||||
* @param acceptAnyProxy flag on whether we accept any proxy or not.
|
||||
*/
|
||||
public void setAcceptAnyProxy(final boolean acceptAnyProxy) {
|
||||
this.acceptAnyProxy = acceptAnyProxy;
|
||||
}
|
||||
|
||||
protected void afterPropertiesSetInternal() {
|
||||
super.afterPropertiesSetInternal();
|
||||
|
||||
CommonUtils.assertTrue(this.proxyChains != null || this.acceptAnyProxy,
|
||||
"proxyChains cannot be null or acceptAnyProxy must be true.");
|
||||
CommonUtils.assertTrue((this.proxyChains != null && !this.proxyChains
|
||||
.isEmpty())
|
||||
|| this.acceptAnyProxy,
|
||||
"proxyChains cannot be empty or acceptAnyProxy must be true.");
|
||||
|
||||
final List tempProxyChains = new ArrayList();
|
||||
for (final Iterator iter = this.proxyChains.iterator(); iter.hasNext();) {
|
||||
final String[] values = ((String) iter.next()).split(" ");
|
||||
final Service[] principals = new Service[values.length];
|
||||
|
||||
for (int i = 0; i < principals.length; i++) {
|
||||
principals[i] = new SimpleService(values[i]);
|
||||
}
|
||||
|
||||
tempProxyChains.add(principals);
|
||||
}
|
||||
|
||||
this.proxyChains = tempProxyChains;
|
||||
.getAttributes(), assertion.getProxyGrantingTicketId());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@
|
|||
*/
|
||||
package org.jasig.cas.client.validation;
|
||||
|
||||
import org.apache.commons.httpclient.HttpClient;
|
||||
import org.jasig.cas.authentication.principal.Service;
|
||||
import org.jasig.cas.authentication.principal.SimplePrincipal;
|
||||
import org.jasig.cas.authentication.principal.SimpleService;
|
||||
import org.jasig.cas.client.proxy.ProxyGrantingTicketStorage;
|
||||
import org.jasig.cas.client.util.CommonUtils;
|
||||
import org.jasig.cas.client.util.XmlUtils;
|
||||
|
|
@ -15,37 +15,53 @@ import org.jasig.cas.client.util.XmlUtils;
|
|||
/**
|
||||
* Implementation of TicketValidator that follows the CAS 2.0 protocol (without
|
||||
* proxying).
|
||||
*
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
*/
|
||||
public class Cas20ServiceTicketValidator extends
|
||||
AbstractUrlBasedTicketValidator {
|
||||
AbstractUrlBasedTicketValidator {
|
||||
|
||||
/** Proxy callback url to send to the CAS server. */
|
||||
private Service proxyCallbackUrl;
|
||||
/**
|
||||
* Proxy callback url to send to the CAS server.
|
||||
*/
|
||||
private final Service proxyCallbackUrl;
|
||||
|
||||
/** The storage mechanism for the ProxyGrantingTickets. */
|
||||
private ProxyGrantingTicketStorage proxyGrantingTicketStorage;
|
||||
/**
|
||||
* The storage mechanism for the ProxyGrantingTickets.
|
||||
*/
|
||||
private final ProxyGrantingTicketStorage proxyGrantingTicketStorage;
|
||||
|
||||
public Cas20ServiceTicketValidator(final String casServerUrl, final boolean renew, final HttpClient httpClient, final ProxyGrantingTicketStorage proxyGrantingTicketStorage) {
|
||||
this(casServerUrl, renew, httpClient, null, proxyGrantingTicketStorage);
|
||||
}
|
||||
|
||||
public Cas20ServiceTicketValidator(final String casServerUrl, final boolean renew, final HttpClient httpClient, final Service proxyCallbackUrl, final ProxyGrantingTicketStorage proxyGrantingTicketStorage) {
|
||||
super(casServerUrl, renew, httpClient);
|
||||
CommonUtils.assertNotNull(proxyGrantingTicketStorage,
|
||||
"proxyGrantingTicketStorage cannot be null");
|
||||
this.proxyCallbackUrl = proxyCallbackUrl;
|
||||
this.proxyGrantingTicketStorage = proxyGrantingTicketStorage;
|
||||
}
|
||||
|
||||
protected String constructURL(final String ticketId,
|
||||
final Service service) {
|
||||
final Service service) {
|
||||
return getCasServerUrl()
|
||||
+ getValidationUrlName()
|
||||
+ "?ticket="
|
||||
+ ticketId
|
||||
+ (isRenew() ? "&renew=true" : "")
|
||||
+ "&service="
|
||||
+ getEncodedService(service)
|
||||
+ (this.proxyCallbackUrl != null ? "&pgtUrl="
|
||||
+ getValidationUrlName()
|
||||
+ "?ticket="
|
||||
+ ticketId
|
||||
+ (isRenew() ? "&renew=true" : "")
|
||||
+ "&service="
|
||||
+ getEncodedService(service)
|
||||
+ (this.proxyCallbackUrl != null ? "&pgtUrl="
|
||||
+ getEncodedService(this.proxyCallbackUrl) : "");
|
||||
}
|
||||
|
||||
protected final Assertion parseResponse(String response)
|
||||
throws ValidationException {
|
||||
throws ValidationException {
|
||||
final String error = XmlUtils.getTextForElement(response,
|
||||
"authenticationFailure");
|
||||
"authenticationFailure");
|
||||
|
||||
if (CommonUtils.isNotBlank(error)) {
|
||||
log.debug("Validation of ticket failed: " + error);
|
||||
|
|
@ -54,7 +70,7 @@ public class Cas20ServiceTicketValidator extends
|
|||
|
||||
final String principal = XmlUtils.getTextForElement(response, "user");
|
||||
final String proxyGrantingTicketIou = XmlUtils.getTextForElement(
|
||||
response, "proxyGrantingTicket");
|
||||
response, "proxyGrantingTicket");
|
||||
|
||||
if (CommonUtils.isEmpty(principal)) {
|
||||
throw new ValidationException("No principal found.");
|
||||
|
|
@ -62,13 +78,13 @@ public class Cas20ServiceTicketValidator extends
|
|||
|
||||
if (CommonUtils.isNotBlank(proxyGrantingTicketIou)) {
|
||||
return getValidAssertionInternal(response, new AssertionImpl(
|
||||
new SimplePrincipal(principal), null,
|
||||
this.proxyGrantingTicketStorage
|
||||
.retrieve(proxyGrantingTicketIou)));
|
||||
new SimplePrincipal(principal), null,
|
||||
this.proxyGrantingTicketStorage
|
||||
.retrieve(proxyGrantingTicketIou)));
|
||||
}
|
||||
|
||||
return getValidAssertionInternal(response, new AssertionImpl(
|
||||
new SimplePrincipal(principal)));
|
||||
new SimplePrincipal(principal)));
|
||||
}
|
||||
|
||||
protected String getValidationUrlName() {
|
||||
|
|
@ -76,32 +92,7 @@ public class Cas20ServiceTicketValidator extends
|
|||
}
|
||||
|
||||
protected Assertion getValidAssertionInternal(final String response,
|
||||
final Assertion assertion) throws ValidationException {
|
||||
final Assertion assertion) throws ValidationException {
|
||||
return assertion;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the proxy callback url
|
||||
*
|
||||
* @param proxyCallbackUrl the proxycallback url specified for this
|
||||
* application.
|
||||
*/
|
||||
public final void setProxyCallbackUrl(final String proxyCallbackUrl) {
|
||||
this.proxyCallbackUrl = new SimpleService(proxyCallbackUrl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the ProxyGrantingTicketStorage
|
||||
*
|
||||
* @param proxyGrantingTicketStorage the storage mechanism to use.
|
||||
*/
|
||||
public final void setProxyGrantingTicketStorage(
|
||||
final ProxyGrantingTicketStorage proxyGrantingTicketStorage) {
|
||||
this.proxyGrantingTicketStorage = proxyGrantingTicketStorage;
|
||||
}
|
||||
|
||||
protected void afterPropertiesSetInternal() {
|
||||
CommonUtils.assertNotNull(this.proxyGrantingTicketStorage,
|
||||
"proxyGrantingTicketStorage cannot be null");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,29 +8,23 @@ package org.jasig.cas.client.validation;
|
|||
/**
|
||||
* Specific instance of a ValidationException that is thrown when the proxy
|
||||
* chain does not match what is returned.
|
||||
*
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
*/
|
||||
public final class InvalidProxyChainValidationException extends ValidationException {
|
||||
|
||||
/** Unique id for serialization. */
|
||||
/**
|
||||
* Unique id for serialization.
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public InvalidProxyChainValidationException() {
|
||||
super();
|
||||
}
|
||||
|
||||
public InvalidProxyChainValidationException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
|
||||
public InvalidProxyChainValidationException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public InvalidProxyChainValidationException(Throwable cause) {
|
||||
super(cause);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import org.jasig.cas.authentication.principal.Service;
|
|||
* Interface to encapsulate the validation of a ticket. The inteface is
|
||||
* specification neutral. Any implementation can be provided, including
|
||||
* something that parses CAS1 or CAS2 responses.
|
||||
*
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
|
|
@ -20,12 +20,12 @@ public interface TicketValidator {
|
|||
|
||||
/**
|
||||
* Method to validate a ticket for a give Service.
|
||||
*
|
||||
*
|
||||
* @param ticketId the ticket to validate
|
||||
* @param service the service to validate the ticket for
|
||||
* @param service the service to validate the ticket for
|
||||
* @return the Assertion about the ticket (never null)
|
||||
* @throws ValidationException if there is a problem validating the ticket.
|
||||
*/
|
||||
Assertion validate(String ticketId, Service service)
|
||||
throws ValidationException;
|
||||
throws ValidationException;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,14 +8,16 @@ package org.jasig.cas.client.validation;
|
|||
/**
|
||||
* Implementation of Exception to be thrown when there is an error validating
|
||||
* the Ticket returned from the CAS server.
|
||||
*
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
*/
|
||||
public class ValidationException extends Exception {
|
||||
|
||||
/** Unique Id for serialization. */
|
||||
/**
|
||||
* Unique Id for serialization.
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
|
|
@ -27,8 +29,9 @@ public class ValidationException extends Exception {
|
|||
|
||||
/**
|
||||
* Constructor that accepts a message and a chained exception.
|
||||
*
|
||||
* @param message the error message.
|
||||
* @param cause the exception we are chaining with.
|
||||
* @param cause the exception we are chaining with.
|
||||
*/
|
||||
public ValidationException(final String message, final Throwable cause) {
|
||||
super(message, cause);
|
||||
|
|
@ -36,6 +39,7 @@ public class ValidationException extends Exception {
|
|||
|
||||
/**
|
||||
* Constructor that accepts a message.
|
||||
*
|
||||
* @param message the error message.
|
||||
*/
|
||||
public ValidationException(final String message) {
|
||||
|
|
@ -44,6 +48,7 @@ public class ValidationException extends Exception {
|
|||
|
||||
/**
|
||||
* Constructor that accepts a chained exception.
|
||||
*
|
||||
* @param cause the exception we are chaining with.
|
||||
*/
|
||||
public ValidationException(final Throwable cause) {
|
||||
|
|
|
|||
|
|
@ -9,29 +9,26 @@ import org.apache.commons.logging.Log;
|
|||
import org.apache.commons.logging.LogFactory;
|
||||
import org.jasig.cas.client.util.CommonUtils;
|
||||
|
||||
import javax.servlet.Filter;
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.FilterConfig;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.*;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Abstract class that contains common functionality amongst CAS filters.
|
||||
* <p>
|
||||
* You must specify the serverName or the serviceUrl. If you specify both, the
|
||||
* <p/>
|
||||
* You must specify the serverName (format: hostname:port) or the serviceUrl. If you specify both, the
|
||||
* serviceUrl is used over the serverName.
|
||||
*
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
*/
|
||||
public abstract class AbstractCasFilter implements Filter {
|
||||
|
||||
/** Constant string representing the ticket parameter. */
|
||||
/**
|
||||
* Constant string representing the ticket parameter.
|
||||
*/
|
||||
public static final String PARAM_TICKET = "ticket";
|
||||
|
||||
/**
|
||||
|
|
@ -40,41 +37,66 @@ public abstract class AbstractCasFilter implements Filter {
|
|||
*/
|
||||
public static final String CONST_ASSERTION = "_cas_assertion_";
|
||||
|
||||
/** Constant representing where we flag a gatewayed request in the session. */
|
||||
/**
|
||||
* Constant representing where we flag a gatewayed request in the session.
|
||||
*/
|
||||
public static final String CONST_GATEWAY = "_cas_gateway_";
|
||||
|
||||
/** Constant representing where we flag a principal. */
|
||||
/**
|
||||
* Constant representing where we flag a principal.
|
||||
*/
|
||||
public static final String CONST_PRINCIPAL = "_cas_principal_";
|
||||
|
||||
/** Instance of Commons Logging. */
|
||||
/**
|
||||
* Instance of Commons Logging.
|
||||
*/
|
||||
protected final Log log = LogFactory.getLog(this.getClass());
|
||||
|
||||
/**
|
||||
* The name of the server in the following format: <hostname>:<port> where
|
||||
* port is optional if its a standard port.
|
||||
*/
|
||||
private String serverName;
|
||||
private final String serverName;
|
||||
|
||||
/** The exact service url to match to. */
|
||||
private String serviceUrl;
|
||||
/**
|
||||
* The exact service url to match to.
|
||||
*/
|
||||
private final String serviceUrl;
|
||||
|
||||
/** Whether to store the entry in session or not. Defaults to true. */
|
||||
private boolean useSession = true;
|
||||
/**
|
||||
* Whether to store the entry in session or not. Defaults to true.
|
||||
*/
|
||||
private final boolean useSession;
|
||||
|
||||
|
||||
protected AbstractCasFilter(final String serverName, final String serviceUrl) {
|
||||
this(serverName, serviceUrl, true);
|
||||
}
|
||||
|
||||
protected AbstractCasFilter(final String serverName, final String serviceUrl, final boolean useSession) {
|
||||
CommonUtils.assertTrue(CommonUtils.isNotBlank(serverName)
|
||||
|| CommonUtils.isNotBlank(serviceUrl),
|
||||
"either serverName or serviceUrl must be set");
|
||||
|
||||
this.serverName = serverName;
|
||||
this.serviceUrl = serviceUrl;
|
||||
this.useSession = useSession;
|
||||
}
|
||||
|
||||
public final void destroy() {
|
||||
// nothing to do
|
||||
}
|
||||
|
||||
public final void doFilter(final ServletRequest servletRequest,
|
||||
final ServletResponse servletResponse, final FilterChain filterChain)
|
||||
throws IOException, ServletException {
|
||||
final ServletResponse servletResponse, final FilterChain filterChain)
|
||||
throws IOException, ServletException {
|
||||
doFilterInternal((HttpServletRequest) servletRequest,
|
||||
(HttpServletResponse) servletResponse, filterChain);
|
||||
(HttpServletResponse) servletResponse, filterChain);
|
||||
}
|
||||
|
||||
protected abstract void doFilterInternal(HttpServletRequest request,
|
||||
HttpServletResponse response, FilterChain filterChain)
|
||||
throws IOException, ServletException;
|
||||
HttpServletResponse response, FilterChain filterChain)
|
||||
throws IOException, ServletException;
|
||||
|
||||
public void init(final FilterConfig filterConfig) throws ServletException {
|
||||
// nothing to do here
|
||||
|
|
@ -84,13 +106,13 @@ public abstract class AbstractCasFilter implements Filter {
|
|||
* Constructs a service url from the HttpServletRequest or from the given
|
||||
* serviceUrl. Prefers the serviceUrl provided if both a serviceUrl and a
|
||||
* serviceName.
|
||||
*
|
||||
* @param request the HttpServletRequest
|
||||
*
|
||||
* @param request the HttpServletRequest
|
||||
* @param response the HttpServletResponse
|
||||
* @return the service url to use.
|
||||
*/
|
||||
protected final String constructServiceUrl(final HttpServletRequest request,
|
||||
final HttpServletResponse response) {
|
||||
final HttpServletResponse response) {
|
||||
if (CommonUtils.isNotBlank(this.serviceUrl)) {
|
||||
return response.encodeURL(this.serviceUrl);
|
||||
}
|
||||
|
|
@ -104,11 +126,11 @@ public abstract class AbstractCasFilter implements Filter {
|
|||
|
||||
if (CommonUtils.isNotBlank(request.getQueryString())) {
|
||||
final int location = request.getQueryString().indexOf(
|
||||
PARAM_TICKET + "=");
|
||||
PARAM_TICKET + "=");
|
||||
|
||||
if (location == 0) {
|
||||
final String returnValue = response.encodeURL(buffer
|
||||
.toString());
|
||||
.toString());
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("serviceUrl generated: " + returnValue);
|
||||
}
|
||||
|
|
@ -121,13 +143,13 @@ public abstract class AbstractCasFilter implements Filter {
|
|||
buffer.append(request.getQueryString());
|
||||
} else if (location > 0) {
|
||||
final int actualLocation = request.getQueryString()
|
||||
.indexOf("&" + PARAM_TICKET + "=");
|
||||
.indexOf("&" + PARAM_TICKET + "=");
|
||||
|
||||
if (actualLocation == -1) {
|
||||
buffer.append(request.getQueryString());
|
||||
} else if (actualLocation > 0) {
|
||||
buffer.append(request.getQueryString().substring(0,
|
||||
actualLocation));
|
||||
actualLocation));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -143,39 +165,4 @@ public abstract class AbstractCasFilter implements Filter {
|
|||
protected final boolean isUseSession() {
|
||||
return this.useSession;
|
||||
}
|
||||
|
||||
protected final void setUseSession(final boolean useSession) {
|
||||
this.useSession = useSession;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the serverName which should be of the format <hostname>:<port>
|
||||
* where port is optional if its a standard port. Either the serverName or
|
||||
* the serviceUrl must be set.
|
||||
*
|
||||
* @param serverName the <hostname>:<port> combination.
|
||||
*/
|
||||
public final void setServerName(final String serverName) {
|
||||
this.serverName = serverName;
|
||||
}
|
||||
|
||||
public final void setServiceUrl(final String serviceUrl) {
|
||||
this.serviceUrl = serviceUrl;
|
||||
}
|
||||
|
||||
public final void init() {
|
||||
CommonUtils.assertTrue(CommonUtils.isNotBlank(this.serverName)
|
||||
|| CommonUtils.isNotBlank(this.serviceUrl),
|
||||
"either serverName or serviceUrl must be set");
|
||||
afterPropertiesSetInternal();
|
||||
}
|
||||
|
||||
/**
|
||||
* Template method for additional checks at initialization.
|
||||
*
|
||||
* @throws Exception any exceptions thrown upon initialization.
|
||||
*/
|
||||
protected void afterPropertiesSetInternal() {
|
||||
// template method
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,46 +5,68 @@
|
|||
*/
|
||||
package org.jasig.cas.client.web.filter;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URLEncoder;
|
||||
import org.jasig.cas.client.util.CommonUtils;
|
||||
import org.jasig.cas.client.validation.Assertion;
|
||||
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import org.jasig.cas.client.util.CommonUtils;
|
||||
import org.jasig.cas.client.validation.Assertion;
|
||||
import java.io.IOException;
|
||||
import java.net.URLEncoder;
|
||||
|
||||
/**
|
||||
* Filter implementation to intercept all requests and attempt to authenticate
|
||||
* the user by redirecting them to CAS (unless the user has a ticket).
|
||||
*
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
*/
|
||||
public final class CasAuthenticationFilter extends AbstractCasFilter {
|
||||
|
||||
/** The URL to the CAS Server login. */
|
||||
private String casServerLoginUrl;
|
||||
/**
|
||||
* The URL to the CAS Server login.
|
||||
*/
|
||||
private final String casServerLoginUrl;
|
||||
|
||||
/** Whether to send the renew request or not. */
|
||||
private boolean renew;
|
||||
/**
|
||||
* Whether to send the renew request or not.
|
||||
*/
|
||||
private final boolean renew;
|
||||
|
||||
/** Whether to send the gateway request or not. */
|
||||
private boolean gateway;
|
||||
/**
|
||||
* Whether to send the gateway request or not.
|
||||
*/
|
||||
private final boolean gateway;
|
||||
|
||||
public CasAuthenticationFilter(final String serverName, final String serviceUrl, final String casServerLoginUrl) {
|
||||
this(serverName, serviceUrl, true, casServerLoginUrl, false, false);
|
||||
}
|
||||
|
||||
public CasAuthenticationFilter(final String serverName, final String serviceUrl, final String casServerLoginUrl, boolean renew, boolean gateway) {
|
||||
this(serverName, serviceUrl, true, casServerLoginUrl, renew, gateway);
|
||||
}
|
||||
|
||||
public CasAuthenticationFilter(String serverName, String serviceUrl, boolean useSession, String casServerLoginUrl, boolean renew, boolean gateway) {
|
||||
super(serverName, serviceUrl, useSession);
|
||||
CommonUtils.assertNotNull(casServerLoginUrl,
|
||||
"the CAS Server Login URL cannot be null.");
|
||||
this.casServerLoginUrl = casServerLoginUrl;
|
||||
this.renew = renew;
|
||||
this.gateway = gateway;
|
||||
}
|
||||
|
||||
protected void doFilterInternal(final HttpServletRequest request,
|
||||
final HttpServletResponse response, final FilterChain filterChain)
|
||||
throws IOException, ServletException {
|
||||
final HttpServletResponse response, final FilterChain filterChain)
|
||||
throws IOException, ServletException {
|
||||
final HttpSession session = request.getSession(isUseSession());
|
||||
final String ticket = request.getParameter(PARAM_TICKET);
|
||||
final Assertion assertion = session != null ? (Assertion) session
|
||||
.getAttribute(CONST_ASSERTION) : null;
|
||||
.getAttribute(CONST_ASSERTION) : null;
|
||||
final boolean wasGatewayed = session != null
|
||||
&& session.getAttribute(CONST_GATEWAY) != null;
|
||||
&& session.getAttribute(CONST_GATEWAY) != null;
|
||||
|
||||
if (CommonUtils.isBlank(ticket) && assertion == null && !wasGatewayed) {
|
||||
if (this.gateway && session != null) {
|
||||
|
|
@ -53,9 +75,9 @@ public final class CasAuthenticationFilter extends AbstractCasFilter {
|
|||
|
||||
final String serviceUrl = constructServiceUrl(request, response);
|
||||
final String urlToRedirectTo = this.casServerLoginUrl + "?service="
|
||||
+ URLEncoder.encode(serviceUrl, "UTF-8")
|
||||
+ (this.renew ? "&renew=true" : "")
|
||||
+ (this.gateway ? "&gateway=true" : "");
|
||||
+ URLEncoder.encode(serviceUrl, "UTF-8")
|
||||
+ (this.renew ? "&renew=true" : "")
|
||||
+ (this.gateway ? "&gateway=true" : "");
|
||||
response.sendRedirect(urlToRedirectTo);
|
||||
return;
|
||||
}
|
||||
|
|
@ -66,21 +88,4 @@ public final class CasAuthenticationFilter extends AbstractCasFilter {
|
|||
|
||||
filterChain.doFilter(request, response);
|
||||
}
|
||||
|
||||
public void setCasServerLoginUrl(final String casServerLoginUrl) {
|
||||
this.casServerLoginUrl = casServerLoginUrl;
|
||||
}
|
||||
|
||||
public void setGateway(final boolean gateway) {
|
||||
this.gateway = gateway;
|
||||
}
|
||||
|
||||
public void setRenew(final boolean renew) {
|
||||
this.renew = renew;
|
||||
}
|
||||
|
||||
protected void afterPropertiesSetInternal() {
|
||||
CommonUtils.assertNotNull(this.casServerLoginUrl,
|
||||
"the CAS Server Login URL cannot be null.");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,17 +20,17 @@ import java.io.IOException;
|
|||
* Simple filter that attempts to determine if someone is authorized to use the
|
||||
* system. Assumes that you are protecting the application with the
|
||||
* AuthenticationFilter such that the Assertion is set in the session.
|
||||
* <p>
|
||||
* <p/>
|
||||
* If a user is not authorized to use the application, the response code of 403
|
||||
* will be sent to the browser.
|
||||
* <p>
|
||||
* <p/>
|
||||
* This filter needs to be configured after both the authentication filter and
|
||||
* the validation filter.
|
||||
*
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
* @see CasAuthorizedDecider
|
||||
* @since 3.0
|
||||
*/
|
||||
public final class CasAuthorizationFilter implements Filter {
|
||||
|
||||
|
|
@ -38,34 +38,43 @@ public final class CasAuthorizationFilter implements Filter {
|
|||
* Decider that determines whether a specified principal has access to the
|
||||
* resource or not.
|
||||
*/
|
||||
private CasAuthorizedDecider decider;
|
||||
private final CasAuthorizedDecider decider;
|
||||
|
||||
/**
|
||||
* @param casAuthorizedDecider the thing actually deciding to grant access or not.
|
||||
*/
|
||||
public CasAuthorizationFilter(final CasAuthorizedDecider casAuthorizedDecider) {
|
||||
CommonUtils.assertNotNull(casAuthorizedDecider,
|
||||
"the casAuthorizedDecider cannot be null.");
|
||||
this.decider = casAuthorizedDecider;
|
||||
}
|
||||
|
||||
public void destroy() {
|
||||
// nothing to do here
|
||||
}
|
||||
|
||||
public void doFilter(final ServletRequest servletRequest,
|
||||
final ServletResponse servletResponse, final FilterChain filterChain)
|
||||
throws IOException, ServletException {
|
||||
final ServletResponse servletResponse, final FilterChain filterChain)
|
||||
throws IOException, ServletException {
|
||||
final HttpServletRequest request = (HttpServletRequest) servletRequest;
|
||||
final HttpServletResponse response = (HttpServletResponse) servletResponse;
|
||||
final Assertion assertion = (Assertion) request.getSession()
|
||||
.getAttribute(AbstractCasFilter.CONST_ASSERTION);
|
||||
.getAttribute(AbstractCasFilter.CONST_ASSERTION);
|
||||
|
||||
if (assertion == null) {
|
||||
throw new ServletException(
|
||||
"assertion session attribute expected but not found.");
|
||||
"assertion session attribute expected but not found.");
|
||||
}
|
||||
|
||||
final Principal principal = assertion.getPrincipal();
|
||||
|
||||
final boolean authorized = this.decider
|
||||
.isAuthorizedToUseApplication(principal);
|
||||
.isAuthorizedToUseApplication(principal);
|
||||
|
||||
if (!authorized) {
|
||||
response.setStatus(HttpServletResponse.SC_FORBIDDEN);
|
||||
throw new AuthorizationException(principal.getId()
|
||||
+ " is not authorized to use this application.");
|
||||
+ " is not authorized to use this application.");
|
||||
}
|
||||
|
||||
filterChain.doFilter(servletRequest, servletResponse);
|
||||
|
|
@ -73,15 +82,5 @@ public final class CasAuthorizationFilter implements Filter {
|
|||
|
||||
public void init(final FilterConfig filterConfig) throws ServletException {
|
||||
// nothing to do here
|
||||
|
||||
}
|
||||
|
||||
public void setDecider(final CasAuthorizedDecider decider) {
|
||||
this.decider = decider;
|
||||
}
|
||||
|
||||
public void init() {
|
||||
CommonUtils.assertNotNull(this.decider,
|
||||
"the casAuthorizedDecider cannot be null.");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,30 +22,60 @@ import java.io.IOException;
|
|||
* will attempt to validate the ticket. On a successful validation, it sets the
|
||||
* Assertion object into the session. On an unsuccessful validation attempt, it
|
||||
* sets the response code to 403.
|
||||
* <p>
|
||||
* <p/>
|
||||
* This filter needs to be configured after the authentication filter (if that
|
||||
* filter exists in the chain).
|
||||
*
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
* @see TicketValidator
|
||||
* @since 3.0
|
||||
*/
|
||||
public final class CasValidationFilter extends AbstractCasFilter {
|
||||
|
||||
/** Instance of the ticket validator. */
|
||||
private TicketValidator ticketValidator;
|
||||
/**
|
||||
* Instance of the ticket validator.
|
||||
*/
|
||||
private final TicketValidator ticketValidator;
|
||||
|
||||
/**
|
||||
* Specify whether the filter should redirect the user agent after a
|
||||
* successful validation to remove the ticket parameter from the query
|
||||
* string.
|
||||
*/
|
||||
private boolean redirectAfterValidation;
|
||||
private final boolean redirectAfterValidation;
|
||||
|
||||
public void doFilterInternal(final HttpServletRequest request,
|
||||
final HttpServletResponse response, final FilterChain filterChain)
|
||||
throws IOException, ServletException {
|
||||
/**
|
||||
* Constructor that takes the severName (or serviceUrl) and the TicketValidator. Either serveName or serviceUrl is required (but not both).
|
||||
*
|
||||
* @param serverName the name of the server in <hostname>:<port> combination, if using a non-standard port.
|
||||
* @param serviceUrl the url to always redirect to.
|
||||
* @param ticketValidator the validator to validate the tickets.
|
||||
*/
|
||||
public CasValidationFilter(final String serverName, final String serviceUrl, final TicketValidator ticketValidator) {
|
||||
this(serverName, serviceUrl, true, ticketValidator, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor that takes the severName (or serviceUrl), TicketValidator, useSession and redirectAfterValidation. Either serveName or serviceUrl is required (but not both).
|
||||
*
|
||||
* @param serverName the name of the server in <hostname>:<port> combination, if using a non-standard port.
|
||||
* @param serviceUrl the url to always redirect to.
|
||||
* @param useSession flag to set whether to store stuff in the session.
|
||||
* @param ticketValidator the validator to validate the tickets.
|
||||
* @param redirectAfterValidation whether to redirect to remove the ticket.
|
||||
*/
|
||||
public CasValidationFilter(final String serverName, final String serviceUrl, final boolean useSession, final TicketValidator ticketValidator, final boolean redirectAfterValidation) {
|
||||
super(serverName, serviceUrl, useSession);
|
||||
CommonUtils.assertNotNull(ticketValidator,
|
||||
"ticketValidator cannot be null.");
|
||||
this.ticketValidator = ticketValidator;
|
||||
this.redirectAfterValidation = redirectAfterValidation;
|
||||
}
|
||||
|
||||
protected void doFilterInternal(final HttpServletRequest request,
|
||||
final HttpServletResponse response, final FilterChain filterChain)
|
||||
throws IOException, ServletException {
|
||||
final String ticket = request.getParameter(PARAM_TICKET);
|
||||
|
||||
if (CommonUtils.isNotBlank(ticket)) {
|
||||
|
|
@ -55,19 +85,19 @@ public final class CasValidationFilter extends AbstractCasFilter {
|
|||
|
||||
try {
|
||||
final Assertion assertion = this.ticketValidator.validate(
|
||||
ticket, new SimpleService(constructServiceUrl(request,
|
||||
ticket, new SimpleService(constructServiceUrl(request,
|
||||
response)));
|
||||
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Successfully authenticated user: "
|
||||
+ assertion.getPrincipal().getId());
|
||||
+ assertion.getPrincipal().getId());
|
||||
}
|
||||
|
||||
request.setAttribute(CONST_PRINCIPAL, assertion.getPrincipal());
|
||||
|
||||
if (isUseSession()) {
|
||||
request.getSession().setAttribute(CONST_ASSERTION,
|
||||
assertion);
|
||||
assertion);
|
||||
}
|
||||
} catch (final ValidationException e) {
|
||||
response.setStatus(HttpServletResponse.SC_FORBIDDEN);
|
||||
|
|
@ -78,35 +108,10 @@ public final class CasValidationFilter extends AbstractCasFilter {
|
|||
|
||||
if (this.redirectAfterValidation) {
|
||||
response.sendRedirect(response
|
||||
.encodeRedirectURL(constructServiceUrl(request, response)));
|
||||
.encodeRedirectURL(constructServiceUrl(request, response)));
|
||||
return;
|
||||
}
|
||||
|
||||
filterChain.doFilter(request, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the ticket validator for validating tickets.
|
||||
*
|
||||
* @param ticketValidator the ticket validator instance we want to use.
|
||||
*/
|
||||
public void setTicketValidator(final TicketValidator ticketValidator) {
|
||||
this.ticketValidator = ticketValidator;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the flag that tells the filter to redirect after the successful
|
||||
* validation.
|
||||
*
|
||||
* @param redirectAfterValidation true if we want to redirect, false
|
||||
* otherwise.
|
||||
*/
|
||||
public void setRedirectAfterValidation(boolean redirectAfterValidation) {
|
||||
this.redirectAfterValidation = redirectAfterValidation;
|
||||
}
|
||||
|
||||
protected void afterPropertiesSetInternal() {
|
||||
CommonUtils.assertNotNull(this.ticketValidator,
|
||||
"ticketValidator cannot be null.");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,10 +24,10 @@ import java.util.Map;
|
|||
* Implementation of a filter that wraps the normal HttpServletRequest with a
|
||||
* wrapper that overrides the getRemoteUser method to retrieve the user from the
|
||||
* CAS Assertion.
|
||||
* <p>
|
||||
* <p/>
|
||||
* This filter needs to be configured in the chain so that it executes after
|
||||
* both the authentication and the validation filters.
|
||||
*
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
|
|
@ -44,22 +44,22 @@ public final class HttpServletRequestWrapperFilter implements Filter {
|
|||
* stored in the user session.
|
||||
*/
|
||||
public void doFilter(final ServletRequest servletRequest,
|
||||
final ServletResponse servletResponse, final FilterChain filterChain)
|
||||
throws IOException, ServletException {
|
||||
final ServletResponse servletResponse, final FilterChain filterChain)
|
||||
throws IOException, ServletException {
|
||||
filterChain.doFilter(new CasHttpServletRequestWrapper(
|
||||
(HttpServletRequest) servletRequest), servletResponse);
|
||||
(HttpServletRequest) servletRequest), servletResponse);
|
||||
}
|
||||
|
||||
public void init(final FilterConfig filterConfig) throws ServletException {
|
||||
// nothing to do
|
||||
}
|
||||
|
||||
protected final class CasHttpServletRequestWrapper implements
|
||||
HttpServletRequest {
|
||||
final class CasHttpServletRequestWrapper implements
|
||||
HttpServletRequest {
|
||||
|
||||
private final HttpServletRequest request;
|
||||
|
||||
protected CasHttpServletRequestWrapper(final HttpServletRequest request) {
|
||||
CasHttpServletRequestWrapper(final HttpServletRequest request) {
|
||||
this.request = request;
|
||||
}
|
||||
|
||||
|
|
@ -113,20 +113,20 @@ public final class HttpServletRequestWrapperFilter implements Filter {
|
|||
|
||||
public String getRemoteUser() {
|
||||
final org.jasig.cas.authentication.principal.Principal p = (org.jasig.cas.authentication.principal.Principal) this.request
|
||||
.getAttribute(AbstractCasFilter.CONST_PRINCIPAL);
|
||||
|
||||
.getAttribute(AbstractCasFilter.CONST_PRINCIPAL);
|
||||
|
||||
if (p != null) {
|
||||
return p.getId();
|
||||
}
|
||||
|
||||
|
||||
final Assertion assertion = (Assertion) WebUtils
|
||||
.getSessionAttribute(this.request,
|
||||
AbstractCasFilter.CONST_ASSERTION);
|
||||
|
||||
.getSessionAttribute(this.request,
|
||||
AbstractCasFilter.CONST_ASSERTION);
|
||||
|
||||
if (assertion != null) {
|
||||
return assertion.getPrincipal().getId();
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
@ -191,7 +191,7 @@ public final class HttpServletRequestWrapperFilter implements Filter {
|
|||
}
|
||||
|
||||
public void setCharacterEncoding(String s)
|
||||
throws UnsupportedEncodingException {
|
||||
throws UnsupportedEncodingException {
|
||||
this.request.setCharacterEncoding(s);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<html>
|
||||
<body>
|
||||
<p>This package contains all of the useful filters related to normal CAS processing, including Authentication, Validation and Authorization.</p>
|
||||
<p>This package contains all of the useful filters related to normal CAS processing, including Authentication,
|
||||
Validation and Authorization.</p>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -1,77 +1,72 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd" default-init-method="init">
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
|
||||
|
||||
<bean id="propertyPlaceholderConfigurer"
|
||||
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
|
||||
<property name="location"
|
||||
value="/WEB-INF/cas-client.properties" />
|
||||
</bean>
|
||||
|
||||
<bean id="ticketValidator"
|
||||
class="org.jasig.cas.client.validation.Cas20ServiceTicketValidator">
|
||||
<property name="proxyCallbackUrl"
|
||||
value="${cas.server.proxyCallbackUrl}" />
|
||||
<property name="proxyGrantingTicketStorage"
|
||||
ref="proxyGrantingTicketStorage" />
|
||||
<property name="casServerUrl" value="${cas.server.url}" />
|
||||
<property name="httpClient">
|
||||
<bean class="org.jasig.cas.util.HttpClient3FactoryBean" />
|
||||
</property>
|
||||
</bean>
|
||||
<bean id="propertyPlaceholderConfigurer"
|
||||
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
|
||||
<property name="location"
|
||||
value="/WEB-INF/cas-client.properties"/>
|
||||
</bean>
|
||||
|
||||
<bean id="proxyGrantingTicketStorage"
|
||||
class="org.jasig.cas.client.proxy.ProxyGrantingTicketStorageImpl" />
|
||||
|
||||
<bean
|
||||
id="casHttpServletRequestWrapperFilter"
|
||||
class="org.jasig.cas.client.web.filter.HttpServletRequestWrapperFilter" />
|
||||
|
||||
<bean
|
||||
id="casValidationFilter"
|
||||
class="org.jasig.cas.client.web.filter.CasValidationFilter">
|
||||
<property
|
||||
name="ticketValidator"
|
||||
ref="ticketValidator" />
|
||||
<property
|
||||
name="serverName"
|
||||
value="localhost:8443" />
|
||||
</bean>
|
||||
|
||||
<bean
|
||||
id="casAuthenticationFilter"
|
||||
class="org.jasig.cas.client.web.filter.CasAuthenticationFilter">
|
||||
<property
|
||||
name="casServerLoginUrl"
|
||||
value="${cas.server.url}login" />
|
||||
<property
|
||||
name="gateway"
|
||||
value="false" />
|
||||
<property
|
||||
name="renew"
|
||||
value="false" />
|
||||
<property
|
||||
name="serverName"
|
||||
value="localhost:8443" />
|
||||
</bean>
|
||||
|
||||
<bean
|
||||
id="casAuthorizationFilter"
|
||||
class="org.jasig.cas.client.web.filter.CasAuthorizationFilter">
|
||||
<property
|
||||
name="decider"
|
||||
ref="decider" />
|
||||
</bean>
|
||||
|
||||
<bean
|
||||
id="decider"
|
||||
class="org.jasig.cas.client.authorization.DefaultCasAuthorizedDeciderImpl">
|
||||
<property
|
||||
name="users">
|
||||
<list>
|
||||
<value>battags</value>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
<bean id="ticketValidator"
|
||||
class="org.jasig.cas.client.validation.Cas20ServiceTicketValidator">
|
||||
<constructor-arg index="0" value="${cas.server.url}"/>
|
||||
<constructor-arg index="1" value="false"/>
|
||||
<constructor-arg index="2">
|
||||
<bean class="org.jasig.cas.util.HttpClient3FactoryBean"/>
|
||||
</constructor-arg>
|
||||
<constructor-arg index="3">
|
||||
<bean
|
||||
class="org.jasig.cas.authentication.principal.SimpleService">
|
||||
<constructor-arg value="${cas.server.proxyCallbackUrl}"/>
|
||||
</bean>
|
||||
</constructor-arg>
|
||||
<constructor-arg index="4" ref="proxyGrantingTicketStorage"/>
|
||||
</bean>
|
||||
|
||||
<bean id="proxyGrantingTicketStorage"
|
||||
class="org.jasig.cas.client.proxy.ProxyGrantingTicketStorageImpl"/>
|
||||
|
||||
<bean
|
||||
id="casHttpServletRequestWrapperFilter"
|
||||
class="org.jasig.cas.client.web.filter.HttpServletRequestWrapperFilter"/>
|
||||
|
||||
<bean
|
||||
id="casValidationFilter"
|
||||
class="org.jasig.cas.client.web.filter.CasValidationFilter">
|
||||
<constructor-arg index="0" value="localhost:8443"/>
|
||||
<constructor-arg index="1">
|
||||
<null/>
|
||||
</constructor-arg>
|
||||
<constructor-arg index="2" ref="ticketValidator"/>
|
||||
</bean>
|
||||
|
||||
<bean
|
||||
id="casAuthenticationFilter"
|
||||
class="org.jasig.cas.client.web.filter.CasAuthenticationFilter">
|
||||
<constructor-arg index="0" value="localhost:8443"/>
|
||||
<constructor-arg index="1">
|
||||
<null/>
|
||||
</constructor-arg>
|
||||
<constructor-arg index="2" value="${cas.server.url}login"/>
|
||||
<constructor-arg index="3" value="false"/>
|
||||
<constructor-arg index="4" value="false"/>
|
||||
</bean>
|
||||
|
||||
<bean
|
||||
id="casAuthorizationFilter"
|
||||
class="org.jasig.cas.client.web.filter.CasAuthorizationFilter">
|
||||
<constructor-arg index="0" ref="decider"></constructor-arg>
|
||||
</bean>
|
||||
|
||||
<bean
|
||||
id="decider"
|
||||
class="org.jasig.cas.client.authorization.DefaultCasAuthorizedDeciderImpl">
|
||||
<constructor-arg index="0">
|
||||
<list>
|
||||
<value>battags</value>
|
||||
</list>
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
</beans>
|
||||
|
|
@ -3,18 +3,18 @@
|
|||
|
||||
<web-app>
|
||||
<display-name>Java CAS Client</display-name>
|
||||
|
||||
<!--
|
||||
- Location of the XML file that defines the root application context
|
||||
- Applied by ContextLoaderListener.
|
||||
-->
|
||||
<context-param>
|
||||
<param-name>contextConfigLocation</param-name>
|
||||
<param-value>
|
||||
/WEB-INF/simpleFilterExample.xml
|
||||
</param-value>
|
||||
</context-param>
|
||||
|
||||
|
||||
<!--
|
||||
- Location of the XML file that defines the root application context
|
||||
- Applied by ContextLoaderListener.
|
||||
-->
|
||||
<context-param>
|
||||
<param-name>contextConfigLocation</param-name>
|
||||
<param-value>
|
||||
/WEB-INF/simpleFilterExample.xml
|
||||
</param-value>
|
||||
</context-param>
|
||||
|
||||
<filter>
|
||||
<filter-name>CAS Authentication Filter Proxy</filter-name>
|
||||
<filter-class>org.jasig.cas.client.util.FilterToBeanProxy</filter-class>
|
||||
|
|
@ -23,8 +23,8 @@
|
|||
<param-value>casAuthenticationFilter</param-value>
|
||||
</init-param>
|
||||
</filter>
|
||||
|
||||
<filter>
|
||||
|
||||
<filter>
|
||||
<filter-name>CAS Validation Filter Proxy</filter-name>
|
||||
<filter-class>org.jasig.cas.client.util.FilterToBeanProxy</filter-class>
|
||||
<init-param>
|
||||
|
|
@ -32,8 +32,8 @@
|
|||
<param-value>casValidationFilter</param-value>
|
||||
</init-param>
|
||||
</filter>
|
||||
|
||||
<filter>
|
||||
|
||||
<filter>
|
||||
<filter-name>CAS Authorization Filter Proxy</filter-name>
|
||||
<filter-class>org.jasig.cas.client.util.FilterToBeanProxy</filter-class>
|
||||
<init-param>
|
||||
|
|
@ -41,42 +41,42 @@
|
|||
<param-value>casAuthorizationFilter</param-value>
|
||||
</init-param>
|
||||
</filter>
|
||||
|
||||
<filter-mapping>
|
||||
<filter-name>CAS Authentication Filter Proxy</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
|
||||
<filter-mapping>
|
||||
<filter-name>CAS Validation Filter Proxy</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
|
||||
<filter-mapping>
|
||||
<filter-name>CAS Authorization Filter Proxy</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
|
||||
<!--
|
||||
- Loads the root application context of this web app at startup.
|
||||
- The application context is then available via
|
||||
- WebApplicationContextUtils.getWebApplicationContext(servletContext).
|
||||
-->
|
||||
<listener>
|
||||
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
|
||||
</listener>
|
||||
|
||||
<!--
|
||||
- Provides core MVC application controller. See contacts-servlet.xml.
|
||||
-->
|
||||
<servlet>
|
||||
<servlet-name>casclient</servlet-name>
|
||||
<servlet-class>org.jasig.cas.client.proxy.ProxyReceptorServlet</servlet-class>
|
||||
<load-on-startup>1</load-on-startup>
|
||||
</servlet>
|
||||
<filter-mapping>
|
||||
<filter-name>CAS Authentication Filter Proxy</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>casclient</servlet-name>
|
||||
<url-pattern>/proxy/Receptor</url-pattern>
|
||||
</servlet-mapping>
|
||||
<filter-mapping>
|
||||
<filter-name>CAS Validation Filter Proxy</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
|
||||
<filter-mapping>
|
||||
<filter-name>CAS Authorization Filter Proxy</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
|
||||
<!--
|
||||
- Loads the root application context of this web app at startup.
|
||||
- The application context is then available via
|
||||
- WebApplicationContextUtils.getWebApplicationContext(servletContext).
|
||||
-->
|
||||
<listener>
|
||||
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
|
||||
</listener>
|
||||
|
||||
<!--
|
||||
- Provides core MVC application controller. See contacts-servlet.xml.
|
||||
-->
|
||||
<servlet>
|
||||
<servlet-name>casclient</servlet-name>
|
||||
<servlet-class>org.jasig.cas.client.proxy.ProxyReceptorServlet</servlet-class>
|
||||
<load-on-startup>1</load-on-startup>
|
||||
</servlet>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>casclient</servlet-name>
|
||||
<url-pattern>/proxy/Receptor</url-pattern>
|
||||
</servlet-mapping>
|
||||
</web-app>
|
||||
|
|
@ -1,12 +1,7 @@
|
|||
package org.jasig.cas.client;
|
||||
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.io.*;
|
||||
import java.net.ServerSocket;
|
||||
import java.net.Socket;
|
||||
|
||||
|
|
@ -15,7 +10,7 @@ import java.net.Socket;
|
|||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
*/
|
||||
public class PublicTestHttpServer extends Thread {
|
||||
public final class PublicTestHttpServer extends Thread {
|
||||
|
||||
private static PublicTestHttpServer httpServer;
|
||||
|
||||
|
|
@ -28,19 +23,19 @@ public class PublicTestHttpServer extends Thread {
|
|||
public String encoding;
|
||||
|
||||
private PublicTestHttpServer(String data, String encoding, String MIMEType,
|
||||
int port) throws UnsupportedEncodingException {
|
||||
int port) throws UnsupportedEncodingException {
|
||||
this(data.getBytes(encoding), encoding, MIMEType, port);
|
||||
}
|
||||
|
||||
private PublicTestHttpServer(byte[] data, String encoding, String MIMEType,
|
||||
int port) throws UnsupportedEncodingException {
|
||||
int port) throws UnsupportedEncodingException {
|
||||
|
||||
this.content = data;
|
||||
this.port = port;
|
||||
this.encoding = encoding;
|
||||
String header = "HTTP/1.0 200 OK\r\n" + "Server: OneFile 1.0\r\n"
|
||||
// + "Content-length: " + this.content.length + "\r\n"
|
||||
+ "Content-type: " + MIMEType + "\r\n\r\n";
|
||||
// + "Content-length: " + this.content.length + "\r\n"
|
||||
+ "Content-type: " + MIMEType + "\r\n\r\n";
|
||||
this.header = header.getBytes("ASCII");
|
||||
|
||||
}
|
||||
|
|
@ -49,7 +44,7 @@ public class PublicTestHttpServer extends Thread {
|
|||
if (httpServer == null) {
|
||||
try {
|
||||
httpServer = new PublicTestHttpServer("test", "ASCII",
|
||||
"text/plain", 8085);
|
||||
"text/plain", 8085);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
|
@ -65,16 +60,16 @@ public class PublicTestHttpServer extends Thread {
|
|||
try {
|
||||
ServerSocket server = new ServerSocket(this.port);
|
||||
System.out.println("Accepting connections on port "
|
||||
+ server.getLocalPort());
|
||||
+ server.getLocalPort());
|
||||
while (true) {
|
||||
|
||||
Socket connection = null;
|
||||
try {
|
||||
connection = server.accept();
|
||||
OutputStream out = new BufferedOutputStream(connection
|
||||
.getOutputStream());
|
||||
.getOutputStream());
|
||||
InputStream in = new BufferedInputStream(connection
|
||||
.getInputStream());
|
||||
.getInputStream());
|
||||
// read the first line only; that's all we need
|
||||
StringBuffer request = new StringBuffer(80);
|
||||
while (true) {
|
||||
|
|
|
|||
|
|
@ -5,13 +5,12 @@
|
|||
*/
|
||||
package org.jasig.cas.client.authorization;
|
||||
|
||||
import org.jasig.cas.authentication.principal.SimplePrincipal;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
import org.jasig.cas.authentication.principal.SimplePrincipal;
|
||||
|
||||
/**
|
||||
* Abstract test for all CasAuthorizedDecider implementations.
|
||||
*
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
|
|
@ -22,17 +21,17 @@ public abstract class AbstractCasAuthorizedDeciderTests extends TestCase {
|
|||
|
||||
protected abstract CasAuthorizedDecider getCasAuthorizedDeciderImpl();
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
protected final void setUp() throws Exception {
|
||||
this.casAuthorizedDecider = getCasAuthorizedDeciderImpl();
|
||||
}
|
||||
|
||||
public void testIsAuthorized() {
|
||||
public final void testIsAuthorized() {
|
||||
assertTrue(this.casAuthorizedDecider
|
||||
.isAuthorizedToUseApplication(new SimplePrincipal("scott")));
|
||||
.isAuthorizedToUseApplication(new SimplePrincipal("scott")));
|
||||
}
|
||||
|
||||
public void testIsNotAuthorized() {
|
||||
public final void testIsNotAuthorized() {
|
||||
assertFalse(this.casAuthorizedDecider
|
||||
.isAuthorizedToUseApplication(new SimplePrincipal("not")));
|
||||
.isAuthorizedToUseApplication(new SimplePrincipal("not")));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import junit.framework.TestCase;
|
|||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
*/
|
||||
public class AuthorizationExceptionTests extends TestCase {
|
||||
public final class AuthorizationExceptionTests extends TestCase {
|
||||
|
||||
private static final String CONST_MESSAGE = "t";
|
||||
|
||||
|
|
@ -20,7 +20,7 @@ public class AuthorizationExceptionTests extends TestCase {
|
|||
|
||||
public void testMessageThrowable() {
|
||||
final AuthorizationException e = new AuthorizationException(
|
||||
CONST_MESSAGE, CONST_THROWABLE);
|
||||
CONST_MESSAGE, CONST_THROWABLE);
|
||||
|
||||
assertEquals(CONST_MESSAGE, e.getMessage());
|
||||
assertEquals(CONST_THROWABLE, e.getCause());
|
||||
|
|
@ -28,14 +28,14 @@ public class AuthorizationExceptionTests extends TestCase {
|
|||
|
||||
public void testMessage() {
|
||||
final AuthorizationException e = new AuthorizationException(
|
||||
CONST_MESSAGE);
|
||||
CONST_MESSAGE);
|
||||
|
||||
assertEquals(CONST_MESSAGE, e.getMessage());
|
||||
}
|
||||
|
||||
public void testThrowable() {
|
||||
final AuthorizationException e = new AuthorizationException(
|
||||
CONST_THROWABLE);
|
||||
CONST_THROWABLE);
|
||||
|
||||
assertEquals(CONST_THROWABLE, e.getCause());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,14 +9,13 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
public final class DefaultCasAuthorizedDeciderImplTests extends
|
||||
AbstractCasAuthorizedDeciderTests {
|
||||
AbstractCasAuthorizedDeciderTests {
|
||||
|
||||
public CasAuthorizedDecider getCasAuthorizedDeciderImpl() {
|
||||
final DefaultCasAuthorizedDeciderImpl impl = new DefaultCasAuthorizedDeciderImpl();
|
||||
final List list = new ArrayList();
|
||||
list.add("scott");
|
||||
impl.setUsers(list);
|
||||
impl.init();
|
||||
|
||||
final DefaultCasAuthorizedDeciderImpl impl = new DefaultCasAuthorizedDeciderImpl(list);
|
||||
return impl;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,18 +16,18 @@ public abstract class AbstractProxyGrantingTicketStorageTests extends TestCase {
|
|||
|
||||
protected ProxyGrantingTicketStorageImpl proxyGrantingTicketStorageImpl;
|
||||
|
||||
public void testNullValue() {
|
||||
public final void testNullValue() {
|
||||
assertNull(this.proxyGrantingTicketStorageImpl
|
||||
.retrieve("this should not exist"));
|
||||
.retrieve("this should not exist"));
|
||||
}
|
||||
|
||||
public void testValueExists() {
|
||||
public final void testValueExists() {
|
||||
final String CONST_KEY = "testKey";
|
||||
final String CONST_VALUE = "testValue";
|
||||
|
||||
this.proxyGrantingTicketStorageImpl.save(CONST_KEY, CONST_VALUE);
|
||||
|
||||
assertEquals(CONST_VALUE, this.proxyGrantingTicketStorageImpl
|
||||
.retrieve(CONST_KEY));
|
||||
.retrieve(CONST_KEY));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,17 +7,15 @@ package org.jasig.cas.client.proxy;
|
|||
|
||||
/**
|
||||
* Test cases for the ProxyGrantingTicketStorageImplTests.
|
||||
*
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
*/
|
||||
public class ProxyGrantingTicketStorageImplTests extends
|
||||
AbstractProxyGrantingTicketStorageTests {
|
||||
public final class ProxyGrantingTicketStorageImplTests extends
|
||||
AbstractProxyGrantingTicketStorageTests {
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
this.proxyGrantingTicketStorageImpl = new ProxyGrantingTicketStorageImpl();
|
||||
this.proxyGrantingTicketStorageImpl.setTimeout(1000);
|
||||
this.proxyGrantingTicketStorageImpl.init();
|
||||
this.proxyGrantingTicketStorageImpl = new ProxyGrantingTicketStorageImpl(1000);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import org.springframework.web.context.support.XmlWebApplicationContext;
|
|||
|
||||
import javax.servlet.ServletConfig;
|
||||
|
||||
public class SpringConfiguredProxyReceptorServletTests extends TestCase {
|
||||
public final class SpringConfiguredProxyReceptorServletTests extends TestCase {
|
||||
|
||||
private XmlWebApplicationContext webApplicationContext;
|
||||
|
||||
|
|
@ -23,7 +23,7 @@ public class SpringConfiguredProxyReceptorServletTests extends TestCase {
|
|||
AbstractProxyReceptorServlet servlet = new SpringConfiguredProxyReceptorServlet();
|
||||
try {
|
||||
servlet
|
||||
.init(getServletConfig("classpath:badProxyGrantingTicketStorageConfig.xml"));
|
||||
.init(getServletConfig("classpath:badProxyGrantingTicketStorageConfig.xml"));
|
||||
fail("Exception expected.");
|
||||
} catch (final Exception e) {
|
||||
// expected
|
||||
|
|
@ -34,7 +34,7 @@ public class SpringConfiguredProxyReceptorServletTests extends TestCase {
|
|||
AbstractProxyReceptorServlet servlet = new SpringConfiguredProxyReceptorServlet();
|
||||
try {
|
||||
servlet
|
||||
.init(getServletConfig("classpath:twoProxyGrantingTicketStorageConfig.xml"));
|
||||
.init(getServletConfig("classpath:twoProxyGrantingTicketStorageConfig.xml"));
|
||||
fail("Exception expected.");
|
||||
} catch (final Exception e) {
|
||||
// expected
|
||||
|
|
@ -45,7 +45,7 @@ public class SpringConfiguredProxyReceptorServletTests extends TestCase {
|
|||
AbstractProxyReceptorServlet servlet = new SpringConfiguredProxyReceptorServlet();
|
||||
try {
|
||||
servlet
|
||||
.init(getServletConfig("classpath:oneProxyGrantingTicketStorageConfig.xml"));
|
||||
.init(getServletConfig("classpath:oneProxyGrantingTicketStorageConfig.xml"));
|
||||
} catch (final Exception e) {
|
||||
fail("Unexpected excception.");
|
||||
}
|
||||
|
|
@ -54,7 +54,7 @@ public class SpringConfiguredProxyReceptorServletTests extends TestCase {
|
|||
public void testNoPgtOrPgtIouPassed() throws Exception {
|
||||
final AbstractProxyReceptorServlet servlet = new SpringConfiguredProxyReceptorServlet();
|
||||
servlet
|
||||
.init(getServletConfig("classpath:proxyGrantingTicketStorageConfig.xml"));
|
||||
.init(getServletConfig("classpath:proxyGrantingTicketStorageConfig.xml"));
|
||||
|
||||
final MockHttpServletResponse response = new MockHttpServletResponse();
|
||||
servlet.doGet(new MockHttpServletRequest(), response);
|
||||
|
|
@ -65,10 +65,10 @@ public class SpringConfiguredProxyReceptorServletTests extends TestCase {
|
|||
public void testPgtPassed() throws Exception {
|
||||
final AbstractProxyReceptorServlet servlet = new SpringConfiguredProxyReceptorServlet();
|
||||
servlet
|
||||
.init(getServletConfig("classpath:proxyGrantingTicketStorageConfig.xml"));
|
||||
.init(getServletConfig("classpath:proxyGrantingTicketStorageConfig.xml"));
|
||||
|
||||
final ProxyGrantingTicketStorage storage = (ProxyGrantingTicketStorage) this.webApplicationContext
|
||||
.getBean("proxyGrantingTicketStorage");
|
||||
.getBean("proxyGrantingTicketStorage");
|
||||
|
||||
final MockHttpServletRequest request = new MockHttpServletRequest();
|
||||
request.setParameter("pgtIou", "test");
|
||||
|
|
@ -83,13 +83,13 @@ public class SpringConfiguredProxyReceptorServletTests extends TestCase {
|
|||
private ServletConfig getServletConfig(final String contextLocation) {
|
||||
this.webApplicationContext = new XmlWebApplicationContext();
|
||||
this.webApplicationContext
|
||||
.setConfigLocations(new String[] {contextLocation});
|
||||
.setConfigLocations(new String[]{contextLocation});
|
||||
this.webApplicationContext.refresh();
|
||||
|
||||
MockServletContext context = new MockServletContext();
|
||||
context.setAttribute(
|
||||
WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE,
|
||||
this.webApplicationContext);
|
||||
WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE,
|
||||
this.webApplicationContext);
|
||||
|
||||
return new MockServletConfig(context);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,19 +5,19 @@
|
|||
*/
|
||||
package org.jasig.cas.client.util;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
/**
|
||||
* Tests for the CommonUtils.
|
||||
*
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
*/
|
||||
public class CommonUtilsTests extends TestCase {
|
||||
public final class CommonUtilsTests extends TestCase {
|
||||
|
||||
public void testAssertNotNull() {
|
||||
final String CONST_MESSAGE = "test";
|
||||
|
|
|
|||
|
|
@ -16,12 +16,12 @@ import java.util.Map;
|
|||
|
||||
/**
|
||||
* Test Cases for <code>DelegatingFilter</code>
|
||||
*
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
*/
|
||||
public class DelegatingFilterTests extends TestCase {
|
||||
public final class DelegatingFilterTests extends TestCase {
|
||||
|
||||
private DelegatingFilter delegatingFilter;
|
||||
|
||||
|
|
@ -33,12 +33,7 @@ public class DelegatingFilterTests extends TestCase {
|
|||
delegators.put("1", new TestFilter(1));
|
||||
|
||||
this.filterExecuted = -1;
|
||||
this.delegatingFilter = new DelegatingFilter();
|
||||
this.delegatingFilter.setDefaultFilter(new TestFilter(0));
|
||||
this.delegatingFilter.setExactMatch(true);
|
||||
this.delegatingFilter.setDelegators(delegators);
|
||||
this.delegatingFilter.setRequestParameterName("test");
|
||||
this.delegatingFilter.init();
|
||||
this.delegatingFilter = new DelegatingFilter("test", delegators, true, new TestFilter(0));
|
||||
this.delegatingFilter.init(null);
|
||||
}
|
||||
|
||||
|
|
@ -51,7 +46,7 @@ public class DelegatingFilterTests extends TestCase {
|
|||
request.addParameter("test", "1");
|
||||
|
||||
this.delegatingFilter.doFilter(request, new MockHttpServletResponse(),
|
||||
null);
|
||||
null);
|
||||
|
||||
assertEquals(1, this.filterExecuted);
|
||||
}
|
||||
|
|
@ -61,14 +56,14 @@ public class DelegatingFilterTests extends TestCase {
|
|||
request.addParameter("test", "0");
|
||||
|
||||
this.delegatingFilter.doFilter(request, new MockHttpServletResponse(),
|
||||
null);
|
||||
null);
|
||||
|
||||
assertEquals(0, this.filterExecuted);
|
||||
}
|
||||
|
||||
public void testNoParam() throws Exception {
|
||||
this.delegatingFilter.doFilter(new MockHttpServletRequest(),
|
||||
new MockHttpServletResponse(), null);
|
||||
new MockHttpServletResponse(), null);
|
||||
|
||||
assertEquals(0, this.filterExecuted);
|
||||
}
|
||||
|
|
@ -79,27 +74,27 @@ public class DelegatingFilterTests extends TestCase {
|
|||
|
||||
delegators.put("1.*", new TestFilter(1));
|
||||
|
||||
this.delegatingFilter.setExactMatch(false);
|
||||
this.delegatingFilter.setDelegators(delegators);
|
||||
this.delegatingFilter = new DelegatingFilter("test", delegators, false, new TestFilter(0));
|
||||
|
||||
MockHttpServletRequest request = new MockHttpServletRequest();
|
||||
request.addParameter("test", "1");
|
||||
|
||||
this.delegatingFilter.doFilter(request, new MockHttpServletResponse(),
|
||||
null);
|
||||
null);
|
||||
|
||||
assertEquals(1, this.filterExecuted);
|
||||
request = new MockHttpServletRequest();
|
||||
request.addParameter("test", "15");
|
||||
|
||||
this.delegatingFilter.doFilter(request, new MockHttpServletResponse(),
|
||||
null);
|
||||
null);
|
||||
|
||||
assertEquals(1, this.filterExecuted);
|
||||
request = new MockHttpServletRequest();
|
||||
request.addParameter("test", "0");
|
||||
|
||||
this.delegatingFilter.doFilter(request, new MockHttpServletResponse(),
|
||||
null);
|
||||
null);
|
||||
|
||||
assertEquals(0, this.filterExecuted);
|
||||
}
|
||||
|
|
@ -108,17 +103,15 @@ public class DelegatingFilterTests extends TestCase {
|
|||
Map map = new HashMap();
|
||||
map.put("test", new Object());
|
||||
|
||||
this.delegatingFilter.setDelegators(map);
|
||||
|
||||
try {
|
||||
this.delegatingFilter.init();
|
||||
this.delegatingFilter = new DelegatingFilter("test", map, false, new TestFilter(0));
|
||||
fail("Exception expected.");
|
||||
} catch (IllegalArgumentException e) {
|
||||
// expected
|
||||
}
|
||||
}
|
||||
|
||||
private class TestFilter implements Filter {
|
||||
private final class TestFilter implements Filter {
|
||||
|
||||
private final int i;
|
||||
|
||||
|
|
@ -131,7 +124,7 @@ public class DelegatingFilterTests extends TestCase {
|
|||
}
|
||||
|
||||
public void doFilter(ServletRequest arg0, ServletResponse arg1,
|
||||
FilterChain arg2) throws IOException, ServletException {
|
||||
FilterChain arg2) throws IOException, ServletException {
|
||||
DelegatingFilterTests.this.filterExecuted = this.i;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import junit.framework.TestCase;
|
|||
|
||||
/**
|
||||
* Base class for all TicketValidator tests to inherit from.
|
||||
*
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import java.util.Map;
|
|||
|
||||
/**
|
||||
* Test cases for the {@link AssertionImpl}.
|
||||
*
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
|
|
@ -41,11 +41,11 @@ public final class AssertionImplTests extends TestCase {
|
|||
|
||||
public void testCompleteConstructor() {
|
||||
final Assertion assertion = new AssertionImpl(CONST_PRINCIPAL,
|
||||
CONST_ATTRIBUTES, CONST_PROXY_GRANTING_TICKET_IOU);
|
||||
CONST_ATTRIBUTES, CONST_PROXY_GRANTING_TICKET_IOU);
|
||||
|
||||
assertEquals(CONST_PRINCIPAL, assertion.getPrincipal());
|
||||
assertEquals(CONST_ATTRIBUTES, assertion.getAttributes());
|
||||
assertEquals(CONST_PROXY_GRANTING_TICKET_IOU, assertion
|
||||
.getProxyGrantingTicketId());
|
||||
.getProxyGrantingTicketId());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import java.io.UnsupportedEncodingException;
|
|||
|
||||
/**
|
||||
* Test cases for the {@link Cas10TicketValidator}.
|
||||
*
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
|
|
@ -28,19 +28,15 @@ public final class Cas10TicketValidatorTests extends AbstractTicketValidatorTest
|
|||
}
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
this.ticketValidator = new Cas10TicketValidator();
|
||||
this.ticketValidator.setCasServerUrl(CONST_CAS_SERVER_URL);
|
||||
this.ticketValidator.setRenew(true);
|
||||
this.ticketValidator.setHttpClient(new HttpClient());
|
||||
this.ticketValidator.init();
|
||||
this.ticketValidator = new Cas10TicketValidator(CONST_CAS_SERVER_URL, true, new HttpClient());
|
||||
}
|
||||
|
||||
public void testNoResponse() throws Exception {
|
||||
PublicTestHttpServer.instance().content = "no\n\n"
|
||||
.getBytes(PublicTestHttpServer.instance().encoding);
|
||||
.getBytes(PublicTestHttpServer.instance().encoding);
|
||||
try {
|
||||
this.ticketValidator.validate("testTicket", new SimpleService(
|
||||
"myService"));
|
||||
"myService"));
|
||||
fail("ValidationException expected.");
|
||||
} catch (final ValidationException e) {
|
||||
// expected
|
||||
|
|
@ -48,20 +44,20 @@ public final class Cas10TicketValidatorTests extends AbstractTicketValidatorTest
|
|||
}
|
||||
|
||||
public void testYesResponse() throws ValidationException,
|
||||
UnsupportedEncodingException {
|
||||
UnsupportedEncodingException {
|
||||
PublicTestHttpServer.instance().content = "yes\nusername\n\n"
|
||||
.getBytes(PublicTestHttpServer.instance().encoding);
|
||||
.getBytes(PublicTestHttpServer.instance().encoding);
|
||||
final Assertion assertion = this.ticketValidator.validate("testTicket",
|
||||
new SimpleService("myService"));
|
||||
new SimpleService("myService"));
|
||||
assertEquals(CONST_USERNAME, assertion.getPrincipal().getId());
|
||||
}
|
||||
|
||||
public void testBadResponse() throws UnsupportedEncodingException {
|
||||
PublicTestHttpServer.instance().content = "falalala\n\n"
|
||||
.getBytes(PublicTestHttpServer.instance().encoding);
|
||||
.getBytes(PublicTestHttpServer.instance().encoding);
|
||||
try {
|
||||
this.ticketValidator.validate("testTicket", new SimpleService(
|
||||
"myService"));
|
||||
"myService"));
|
||||
fail("ValidationException expected.");
|
||||
} catch (final ValidationException e) {
|
||||
// expected
|
||||
|
|
|
|||
|
|
@ -18,13 +18,13 @@ import java.util.List;
|
|||
|
||||
/**
|
||||
* Test cases for the {@link Cas20ProxyTicketValidator}.
|
||||
*
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
*/
|
||||
public final class Cas20ProxyTicketValidatorTests extends
|
||||
AbstractTicketValidatorTests {
|
||||
AbstractTicketValidatorTests {
|
||||
|
||||
private Cas20ProxyTicketValidator ticketValidator;
|
||||
|
||||
|
|
@ -33,46 +33,36 @@ public final class Cas20ProxyTicketValidatorTests extends
|
|||
}
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
ProxyGrantingTicketStorage proxyGrantingTicketStorage = getProxyGrantingTicketStorage();
|
||||
this.ticketValidator = new Cas20ProxyTicketValidator();
|
||||
this.ticketValidator.setCasServerUrl(CONST_CAS_SERVER_URL);
|
||||
this.ticketValidator.setRenew(true);
|
||||
this.ticketValidator
|
||||
.setProxyGrantingTicketStorage(proxyGrantingTicketStorage);
|
||||
this.ticketValidator.setHttpClient(new HttpClient());
|
||||
|
||||
final ProxyGrantingTicketStorage proxyGrantingTicketStorage = getProxyGrantingTicketStorage();
|
||||
final List list = new ArrayList();
|
||||
list.add("proxy1 proxy2 proxy3");
|
||||
this.ticketValidator.setProxyChains(list);
|
||||
|
||||
this.ticketValidator.init();
|
||||
this.ticketValidator = new Cas20ProxyTicketValidator(CONST_CAS_SERVER_URL, true, new HttpClient(), proxyGrantingTicketStorage, list, false);
|
||||
}
|
||||
|
||||
private ProxyGrantingTicketStorage getProxyGrantingTicketStorage()
|
||||
throws Exception {
|
||||
private ProxyGrantingTicketStorage getProxyGrantingTicketStorage() {
|
||||
ProxyGrantingTicketStorageImpl proxyGrantingTicketStorageImpl = new ProxyGrantingTicketStorageImpl();
|
||||
proxyGrantingTicketStorageImpl.init();
|
||||
|
||||
return proxyGrantingTicketStorageImpl;
|
||||
}
|
||||
|
||||
public void testProxyChainWithValidProxy() throws ValidationException,
|
||||
UnsupportedEncodingException {
|
||||
UnsupportedEncodingException {
|
||||
final String USERNAME = "username";
|
||||
final String RESPONSE = "<cas:serviceResponse xmlns:cas='http://www.yale.edu/tp/cas'><cas:authenticationSuccess><cas:user>username</cas:user><cas:proxyGrantingTicket>PGTIOU-84678-8a9d...</cas:proxyGrantingTicket><cas:proxies><cas:proxy>proxy1</cas:proxy><cas:proxy>proxy2</cas:proxy><cas:proxy>proxy3</cas:proxy></cas:proxies></cas:authenticationSuccess></cas:serviceResponse>";
|
||||
PublicTestHttpServer.instance().content = RESPONSE
|
||||
.getBytes(PublicTestHttpServer.instance().encoding);
|
||||
.getBytes(PublicTestHttpServer.instance().encoding);
|
||||
|
||||
final Assertion assertion = this.ticketValidator.validate("test",
|
||||
new SimpleService("test"));
|
||||
new SimpleService("test"));
|
||||
assertEquals(USERNAME, assertion.getPrincipal().getId());
|
||||
}
|
||||
|
||||
public void testProxyChainWithInvalidProxy() throws ValidationException,
|
||||
UnsupportedEncodingException {
|
||||
UnsupportedEncodingException {
|
||||
final String RESPONSE = "<cas:serviceResponse xmlns:cas='http://www.yale.edu/tp/cas'><cas:authenticationSuccess><cas:user>username</cas:user><cas:proxyGrantingTicket>PGTIOU-84678-8a9d...</cas:proxyGrantingTicket><cas:proxies><cas:proxy>proxy7</cas:proxy><cas:proxy>proxy2</cas:proxy><cas:proxy>proxy3</cas:proxy></cas:proxies></cas:authenticationSuccess></cas:serviceResponse>";
|
||||
PublicTestHttpServer.instance().content = RESPONSE
|
||||
.getBytes(PublicTestHttpServer.instance().encoding);
|
||||
.getBytes(PublicTestHttpServer.instance().encoding);
|
||||
|
||||
try {
|
||||
this.ticketValidator.validate("test", new SimpleService("test"));
|
||||
|
|
|
|||
|
|
@ -16,13 +16,13 @@ import java.io.UnsupportedEncodingException;
|
|||
|
||||
/**
|
||||
* Test cases for the {@link Cas20ServiceTicketValidator}.
|
||||
*
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
*/
|
||||
public final class Cas20ServiceTicketValidatorTests extends
|
||||
AbstractTicketValidatorTests {
|
||||
AbstractTicketValidatorTests {
|
||||
|
||||
private Cas20ServiceTicketValidator ticketValidator;
|
||||
|
||||
|
|
@ -34,19 +34,11 @@ public final class Cas20ServiceTicketValidatorTests extends
|
|||
|
||||
protected void setUp() throws Exception {
|
||||
this.proxyGrantingTicketStorage = getProxyGrantingTicketStorage();
|
||||
this.ticketValidator = new Cas20ServiceTicketValidator();
|
||||
this.ticketValidator.setCasServerUrl(CONST_CAS_SERVER_URL);
|
||||
this.ticketValidator.setRenew(true);
|
||||
this.ticketValidator
|
||||
.setProxyGrantingTicketStorage(this.proxyGrantingTicketStorage);
|
||||
this.ticketValidator.setHttpClient(new HttpClient());
|
||||
this.ticketValidator.init();
|
||||
this.ticketValidator = new Cas20ServiceTicketValidator(CONST_CAS_SERVER_URL, true, new HttpClient(), this.proxyGrantingTicketStorage);
|
||||
}
|
||||
|
||||
private ProxyGrantingTicketStorage getProxyGrantingTicketStorage()
|
||||
throws Exception {
|
||||
private ProxyGrantingTicketStorage getProxyGrantingTicketStorage() {
|
||||
ProxyGrantingTicketStorageImpl proxyGrantingTicketStorageImpl = new ProxyGrantingTicketStorageImpl();
|
||||
proxyGrantingTicketStorageImpl.init();
|
||||
|
||||
return proxyGrantingTicketStorageImpl;
|
||||
}
|
||||
|
|
@ -54,7 +46,7 @@ public final class Cas20ServiceTicketValidatorTests extends
|
|||
public void testNoResponse() throws UnsupportedEncodingException {
|
||||
final String RESPONSE = "<cas:serviceResponse xmlns:cas='http://www.yale.edu/tp/cas'><cas:authenticationFailure code=\"INVALID_TICKET\">Ticket ST-1856339-aA5Yuvrxzpv8Tau1cYQ7 not recognized</cas:authenticationFailure></cas:serviceResponse>";
|
||||
PublicTestHttpServer.instance().content = RESPONSE
|
||||
.getBytes(PublicTestHttpServer.instance().encoding);
|
||||
.getBytes(PublicTestHttpServer.instance().encoding);
|
||||
try {
|
||||
this.ticketValidator.validate("test", new SimpleService("test"));
|
||||
fail("ValidationException expected due to 'no' response");
|
||||
|
|
@ -64,37 +56,37 @@ public final class Cas20ServiceTicketValidatorTests extends
|
|||
}
|
||||
|
||||
public void testYesResponseButNoPgt() throws ValidationException,
|
||||
UnsupportedEncodingException {
|
||||
UnsupportedEncodingException {
|
||||
final String USERNAME = "username";
|
||||
final String RESPONSE = "<cas:serviceResponse xmlns:cas='http://www.yale.edu/tp/cas'><cas:authenticationSuccess><cas:user>"
|
||||
+ USERNAME
|
||||
+ "</cas:user></cas:authenticationSuccess></cas:serviceResponse>";
|
||||
+ USERNAME
|
||||
+ "</cas:user></cas:authenticationSuccess></cas:serviceResponse>";
|
||||
PublicTestHttpServer.instance().content = RESPONSE
|
||||
.getBytes(PublicTestHttpServer.instance().encoding);
|
||||
.getBytes(PublicTestHttpServer.instance().encoding);
|
||||
|
||||
final Assertion assertion = this.ticketValidator.validate("test",
|
||||
new SimpleService("test"));
|
||||
new SimpleService("test"));
|
||||
assertEquals(USERNAME, assertion.getPrincipal().getId());
|
||||
}
|
||||
|
||||
public void testYesResponseWithPgt() throws ValidationException,
|
||||
UnsupportedEncodingException {
|
||||
UnsupportedEncodingException {
|
||||
final String USERNAME = "username";
|
||||
final String PGTIOU = "testPgtIou";
|
||||
final String PGT = "test";
|
||||
final String RESPONSE = "<cas:serviceResponse xmlns:cas='http://www.yale.edu/tp/cas'><cas:authenticationSuccess><cas:user>"
|
||||
+ USERNAME
|
||||
+ "</cas:user><cas:proxyGrantingTicket>"
|
||||
+ PGTIOU
|
||||
+ "</cas:proxyGrantingTicket></cas:authenticationSuccess></cas:serviceResponse>";
|
||||
+ USERNAME
|
||||
+ "</cas:user><cas:proxyGrantingTicket>"
|
||||
+ PGTIOU
|
||||
+ "</cas:proxyGrantingTicket></cas:authenticationSuccess></cas:serviceResponse>";
|
||||
|
||||
PublicTestHttpServer.instance().content = RESPONSE
|
||||
.getBytes(PublicTestHttpServer.instance().encoding);
|
||||
.getBytes(PublicTestHttpServer.instance().encoding);
|
||||
|
||||
this.proxyGrantingTicketStorage.save(PGTIOU, PGT);
|
||||
|
||||
final Assertion assertion = this.ticketValidator.validate("test",
|
||||
new SimpleService("test"));
|
||||
new SimpleService("test"));
|
||||
assertEquals(USERNAME, assertion.getPrincipal().getId());
|
||||
assertEquals(PGT, assertion.getProxyGrantingTicketId());
|
||||
}
|
||||
|
|
@ -102,7 +94,7 @@ public final class Cas20ServiceTicketValidatorTests extends
|
|||
public void testInvalidResponse() throws Exception {
|
||||
final String RESPONSE = "<root />";
|
||||
PublicTestHttpServer.instance().content = RESPONSE
|
||||
.getBytes(PublicTestHttpServer.instance().encoding);
|
||||
.getBytes(PublicTestHttpServer.instance().encoding);
|
||||
try {
|
||||
this.ticketValidator.validate("test", new SimpleService("test"));
|
||||
fail("ValidationException expected due to invalid response.");
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import java.net.URLEncoder;
|
|||
|
||||
/**
|
||||
* Tests for the CasAuthenticationFilter.
|
||||
*
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
|
|
@ -36,13 +36,8 @@ public final class CasAuthenticationFilterTests extends TestCase {
|
|||
private CasAuthenticationFilter filter;
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
this.filter = new CasAuthenticationFilter();
|
||||
this.filter.setCasServerLoginUrl(CAS_LOGIN_URL);
|
||||
this.filter.setGateway(false);
|
||||
this.filter.setRenew(false);
|
||||
this.filter.setServiceUrl(CAS_SERVICE_URL);
|
||||
this.filter = new CasAuthenticationFilter(null, CAS_SERVICE_URL, CAS_LOGIN_URL, false, false);
|
||||
this.filter.init(new MockFilterConfig());
|
||||
this.filter.init();
|
||||
}
|
||||
|
||||
protected void tearDown() throws Exception {
|
||||
|
|
@ -53,10 +48,10 @@ public final class CasAuthenticationFilterTests extends TestCase {
|
|||
final MockHttpSession session = new MockHttpSession();
|
||||
final MockHttpServletRequest request = new MockHttpServletRequest();
|
||||
final MockHttpServletResponse response = new MockHttpServletResponse();
|
||||
final FilterChain filterChain = new FilterChain(){
|
||||
final FilterChain filterChain = new FilterChain() {
|
||||
|
||||
public void doFilter(ServletRequest arg0, ServletResponse arg1)
|
||||
throws IOException, ServletException {
|
||||
throws IOException, ServletException {
|
||||
// nothing to do
|
||||
}
|
||||
};
|
||||
|
|
@ -65,8 +60,8 @@ public final class CasAuthenticationFilterTests extends TestCase {
|
|||
this.filter.doFilter(request, response, filterChain);
|
||||
|
||||
assertEquals(CAS_LOGIN_URL + "?service="
|
||||
+ URLEncoder.encode(CAS_SERVICE_URL, "UTF-8"), response
|
||||
.getRedirectedUrl());
|
||||
+ URLEncoder.encode(CAS_SERVICE_URL, "UTF-8"), response
|
||||
.getRedirectedUrl());
|
||||
}
|
||||
|
||||
public void testRedirectWithQueryString() throws Exception {
|
||||
|
|
@ -76,22 +71,21 @@ public final class CasAuthenticationFilterTests extends TestCase {
|
|||
request.setQueryString("test=12456");
|
||||
request.setRequestURI("/test");
|
||||
request.setSecure(true);
|
||||
final FilterChain filterChain = new FilterChain(){
|
||||
final FilterChain filterChain = new FilterChain() {
|
||||
|
||||
public void doFilter(ServletRequest arg0, ServletResponse arg1)
|
||||
throws IOException, ServletException {
|
||||
throws IOException, ServletException {
|
||||
// nothing to do
|
||||
}
|
||||
};
|
||||
|
||||
request.setSession(session);
|
||||
this.filter.setServiceUrl(null);
|
||||
this.filter.setServerName("localhost:8443");
|
||||
this.filter = new CasAuthenticationFilter("localhost:8443", null, CAS_LOGIN_URL, false, false);
|
||||
this.filter.doFilter(request, response, filterChain);
|
||||
|
||||
assertEquals(CAS_LOGIN_URL
|
||||
+ "?service="
|
||||
+ URLEncoder.encode("https://localhost:8443"
|
||||
+ "?service="
|
||||
+ URLEncoder.encode("https://localhost:8443"
|
||||
+ request.getRequestURI() + "?" + request.getQueryString(),
|
||||
"UTF-8"), response.getRedirectedUrl());
|
||||
}
|
||||
|
|
@ -100,17 +94,17 @@ public final class CasAuthenticationFilterTests extends TestCase {
|
|||
final MockHttpSession session = new MockHttpSession();
|
||||
final MockHttpServletRequest request = new MockHttpServletRequest();
|
||||
final MockHttpServletResponse response = new MockHttpServletResponse();
|
||||
final FilterChain filterChain = new FilterChain(){
|
||||
final FilterChain filterChain = new FilterChain() {
|
||||
|
||||
public void doFilter(ServletRequest arg0, ServletResponse arg1)
|
||||
throws IOException, ServletException {
|
||||
throws IOException, ServletException {
|
||||
// nothing to do
|
||||
}
|
||||
};
|
||||
|
||||
request.setSession(session);
|
||||
session.setAttribute(AbstractCasFilter.CONST_ASSERTION,
|
||||
new AssertionImpl(new SimplePrincipal("test")));
|
||||
new AssertionImpl(new SimplePrincipal("test")));
|
||||
this.filter.doFilter(request, response, filterChain);
|
||||
|
||||
assertNull(response.getRedirectedUrl());
|
||||
|
|
@ -120,15 +114,15 @@ public final class CasAuthenticationFilterTests extends TestCase {
|
|||
final MockHttpSession session = new MockHttpSession();
|
||||
final MockHttpServletRequest request = new MockHttpServletRequest();
|
||||
final MockHttpServletResponse response = new MockHttpServletResponse();
|
||||
final FilterChain filterChain = new FilterChain(){
|
||||
final FilterChain filterChain = new FilterChain() {
|
||||
|
||||
public void doFilter(ServletRequest arg0, ServletResponse arg1)
|
||||
throws IOException, ServletException {
|
||||
throws IOException, ServletException {
|
||||
// nothing to do
|
||||
}
|
||||
};
|
||||
|
||||
this.filter.setRenew(true);
|
||||
this.filter = new CasAuthenticationFilter("localhost:8443", null, CAS_LOGIN_URL, true, false);
|
||||
request.setSession(session);
|
||||
this.filter.doFilter(request, response, filterChain);
|
||||
|
||||
|
|
@ -140,16 +134,16 @@ public final class CasAuthenticationFilterTests extends TestCase {
|
|||
final MockHttpSession session = new MockHttpSession();
|
||||
final MockHttpServletRequest request = new MockHttpServletRequest();
|
||||
final MockHttpServletResponse response = new MockHttpServletResponse();
|
||||
final FilterChain filterChain = new FilterChain(){
|
||||
final FilterChain filterChain = new FilterChain() {
|
||||
|
||||
public void doFilter(ServletRequest arg0, ServletResponse arg1)
|
||||
throws IOException, ServletException {
|
||||
throws IOException, ServletException {
|
||||
// nothing to do
|
||||
}
|
||||
};
|
||||
|
||||
request.setSession(session);
|
||||
this.filter.setGateway(true);
|
||||
this.filter = new CasAuthenticationFilter("localhost:8443", null, CAS_LOGIN_URL, true, true);
|
||||
this.filter.doFilter(request, response, filterChain);
|
||||
assertNotNull(session.getAttribute(AbstractCasFilter.CONST_GATEWAY));
|
||||
assertNotNull(response.getRedirectedUrl());
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import java.io.IOException;
|
|||
|
||||
/**
|
||||
* Tests for the CasAuthorizationFilter.
|
||||
*
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
|
|
@ -34,14 +34,13 @@ public final class CasAuthorizationFilterTests extends TestCase {
|
|||
private CasAuthorizationFilter casAuthorizationFilter;
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
this.casAuthorizationFilter = new CasAuthorizationFilter();
|
||||
this.casAuthorizationFilter.setDecider(new CasAuthorizedDecider(){
|
||||
this.casAuthorizationFilter = new CasAuthorizationFilter(new CasAuthorizedDecider() {
|
||||
|
||||
public boolean isAuthorizedToUseApplication(Principal principal) {
|
||||
return principal.getId().equals("scott");
|
||||
}
|
||||
});
|
||||
this.casAuthorizationFilter.init();
|
||||
|
||||
this.casAuthorizationFilter.init(new MockFilterConfig());
|
||||
}
|
||||
|
||||
|
|
@ -56,18 +55,18 @@ public final class CasAuthorizationFilterTests extends TestCase {
|
|||
request.setSession(session);
|
||||
|
||||
session.setAttribute(AbstractCasFilter.CONST_ASSERTION,
|
||||
new AssertionImpl(new SimplePrincipal("scott")));
|
||||
new AssertionImpl(new SimplePrincipal("scott")));
|
||||
|
||||
try {
|
||||
this.casAuthorizationFilter.doFilter(request, response,
|
||||
new FilterChain(){
|
||||
new FilterChain() {
|
||||
|
||||
public void doFilter(ServletRequest arg0,
|
||||
ServletResponse arg1) throws IOException,
|
||||
ServletException {
|
||||
// nothing to do
|
||||
}
|
||||
});
|
||||
public void doFilter(ServletRequest arg0,
|
||||
ServletResponse arg1) throws IOException,
|
||||
ServletException {
|
||||
// nothing to do
|
||||
}
|
||||
});
|
||||
} catch (Exception e) {
|
||||
fail("No exception expected");
|
||||
}
|
||||
|
|
@ -80,7 +79,7 @@ public final class CasAuthorizationFilterTests extends TestCase {
|
|||
request.setSession(session);
|
||||
|
||||
session.setAttribute(AbstractCasFilter.CONST_ASSERTION,
|
||||
new AssertionImpl(new SimplePrincipal("test")));
|
||||
new AssertionImpl(new SimplePrincipal("test")));
|
||||
|
||||
try {
|
||||
this.casAuthorizationFilter.doFilter(request, response, null);
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import java.io.IOException;
|
|||
|
||||
/**
|
||||
* Tests for the CasValidationFilter.
|
||||
*
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
|
|
@ -34,19 +34,16 @@ public final class CasValidationFilterTests extends TestCase {
|
|||
private CasValidationFilter filter;
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
this.filter = new CasValidationFilter();
|
||||
this.filter.setServerName("https://localhost");
|
||||
this.filter.setTicketValidator(new TicketValidator(){
|
||||
this.filter = new CasValidationFilter("localhost:8443", null, new TicketValidator() {
|
||||
|
||||
public Assertion validate(final String ticketId,
|
||||
final Service service) throws ValidationException {
|
||||
final Service service) throws ValidationException {
|
||||
if (ticketId.equals("true")) {
|
||||
return new AssertionImpl(new SimplePrincipal("test"));
|
||||
}
|
||||
throw new ValidationException("error validating ticket.");
|
||||
}
|
||||
});
|
||||
this.filter.init();
|
||||
}
|
||||
|
||||
protected void tearDown() throws Exception {
|
||||
|
|
@ -58,11 +55,11 @@ public final class CasValidationFilterTests extends TestCase {
|
|||
final MockHttpServletResponse response = new MockHttpServletResponse();
|
||||
final MockHttpSession session = new MockHttpSession();
|
||||
request.setSession(session);
|
||||
final FilterChain filterChain = new FilterChain(){
|
||||
final FilterChain filterChain = new FilterChain() {
|
||||
|
||||
public void doFilter(final ServletRequest arg0,
|
||||
final ServletResponse arg1) throws IOException,
|
||||
ServletException {
|
||||
final ServletResponse arg1) throws IOException,
|
||||
ServletException {
|
||||
// nothing to do
|
||||
}
|
||||
};
|
||||
|
|
@ -78,11 +75,11 @@ public final class CasValidationFilterTests extends TestCase {
|
|||
final MockHttpSession session = new MockHttpSession();
|
||||
request.setSession(session);
|
||||
request.setParameter(AbstractCasFilter.PARAM_TICKET, "true");
|
||||
final FilterChain filterChain = new FilterChain(){
|
||||
final FilterChain filterChain = new FilterChain() {
|
||||
|
||||
public void doFilter(final ServletRequest arg0,
|
||||
final ServletResponse arg1) throws IOException,
|
||||
ServletException {
|
||||
final ServletResponse arg1) throws IOException,
|
||||
ServletException {
|
||||
// nothing to do
|
||||
}
|
||||
};
|
||||
|
|
@ -98,11 +95,11 @@ public final class CasValidationFilterTests extends TestCase {
|
|||
final MockHttpSession session = new MockHttpSession();
|
||||
request.setSession(session);
|
||||
request.setParameter(AbstractCasFilter.PARAM_TICKET, "false");
|
||||
final FilterChain filterChain = new FilterChain(){
|
||||
final FilterChain filterChain = new FilterChain() {
|
||||
|
||||
public void doFilter(final ServletRequest arg0,
|
||||
final ServletResponse arg1) throws IOException,
|
||||
ServletException {
|
||||
final ServletResponse arg1) throws IOException,
|
||||
ServletException {
|
||||
// nothing to do
|
||||
}
|
||||
};
|
||||
|
|
@ -112,7 +109,7 @@ public final class CasValidationFilterTests extends TestCase {
|
|||
fail("Exception expected.");
|
||||
} catch (final ServletException e) {
|
||||
assertTrue(e.getRootCause().getClass().isAssignableFrom(
|
||||
ValidationException.class));
|
||||
ValidationException.class));
|
||||
// expected
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import java.io.IOException;
|
|||
|
||||
/**
|
||||
* Tests for the HttpServletRequestWrapperFilter.
|
||||
*
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
|
|
@ -41,115 +41,115 @@ public final class HttpServletRequestWrapperFilterTests extends TestCase {
|
|||
public void testWrappedRequest() throws Exception {
|
||||
final MockHttpServletRequest request = new MockHttpServletRequest();
|
||||
final MockHttpSession session = new MockHttpSession();
|
||||
final FilterChain filterChain = new FilterChain(){
|
||||
final FilterChain filterChain = new FilterChain() {
|
||||
|
||||
public void doFilter(ServletRequest request,
|
||||
ServletResponse response) throws IOException, ServletException {
|
||||
ServletResponse response) throws IOException, ServletException {
|
||||
HttpServletRequestWrapperFilterTests.this.mockRequest = (HttpServletRequest) request;
|
||||
}
|
||||
|
||||
};
|
||||
session.setAttribute(AbstractCasFilter.CONST_ASSERTION,
|
||||
new AssertionImpl(new SimplePrincipal("test")));
|
||||
new AssertionImpl(new SimplePrincipal("test")));
|
||||
|
||||
request.setSession(session);
|
||||
|
||||
this.filter.doFilter(request, new MockHttpServletResponse(),
|
||||
filterChain);
|
||||
filterChain);
|
||||
assertEquals("test", this.mockRequest.getRemoteUser());
|
||||
assertEquals(request.getAttributeNames(), this.mockRequest
|
||||
.getAttributeNames());
|
||||
.getAttributeNames());
|
||||
assertEquals(request.getAuthType(), this.mockRequest.getAuthType());
|
||||
|
||||
this.mockRequest.setCharacterEncoding("test");
|
||||
|
||||
assertEquals(request.getCharacterEncoding(), this.mockRequest
|
||||
.getCharacterEncoding());
|
||||
.getCharacterEncoding());
|
||||
assertNotSame(request.getClass(), this.mockRequest.getClass());
|
||||
assertEquals(request.getContentLength(), this.mockRequest
|
||||
.getContentLength());
|
||||
.getContentLength());
|
||||
assertEquals(request.getContentType(), this.mockRequest
|
||||
.getContentType());
|
||||
.getContentType());
|
||||
assertEquals(request.getContextPath(), this.mockRequest
|
||||
.getContextPath());
|
||||
.getContextPath());
|
||||
assertEquals(request.getCookies(), this.mockRequest.getCookies());
|
||||
assertEquals(request.getHeaderNames(), this.mockRequest
|
||||
.getHeaderNames());
|
||||
.getHeaderNames());
|
||||
assertEquals(request.getInputStream(), this.mockRequest
|
||||
.getInputStream());
|
||||
.getInputStream());
|
||||
assertEquals(request.getLocalAddr(), this.mockRequest.getLocalAddr());
|
||||
assertEquals(request.getLocale(), this.mockRequest.getLocale());
|
||||
assertEquals(request.getLocales().hasMoreElements(), this.mockRequest
|
||||
.getLocales().hasMoreElements());
|
||||
.getLocales().hasMoreElements());
|
||||
assertEquals(request.getLocalName(), this.mockRequest.getLocalName());
|
||||
assertEquals(request.getLocalPort(), this.mockRequest.getLocalPort());
|
||||
assertEquals(request.getMethod(), this.mockRequest.getMethod());
|
||||
assertEquals(request.getParameterMap(), this.mockRequest
|
||||
.getParameterMap());
|
||||
.getParameterMap());
|
||||
assertEquals(request.getParameterNames().hasMoreElements(),
|
||||
this.mockRequest.getParameterNames().hasMoreElements());
|
||||
this.mockRequest.getParameterNames().hasMoreElements());
|
||||
assertEquals(request.getPathInfo(), this.mockRequest.getPathInfo());
|
||||
assertEquals(request.getPathTranslated(), this.mockRequest
|
||||
.getPathTranslated());
|
||||
.getPathTranslated());
|
||||
assertEquals(request.getProtocol(), this.mockRequest.getProtocol());
|
||||
assertEquals(request.getQueryString(), this.mockRequest
|
||||
.getQueryString());
|
||||
.getQueryString());
|
||||
assertEquals(request.getReader(), this.mockRequest.getReader());
|
||||
assertEquals(request.getRemoteAddr(), this.mockRequest.getRemoteAddr());
|
||||
assertEquals(request.getRemoteHost(), this.mockRequest.getRemoteHost());
|
||||
assertEquals(request.getRemotePort(), this.mockRequest.getRemotePort());
|
||||
assertEquals(request.getRequestedSessionId(), this.mockRequest
|
||||
.getRequestedSessionId());
|
||||
.getRequestedSessionId());
|
||||
assertEquals(request.getRequestURI(), this.mockRequest.getRequestURI());
|
||||
assertEquals(request.getRequestURL().toString(), this.mockRequest
|
||||
.getRequestURL().toString());
|
||||
.getRequestURL().toString());
|
||||
assertEquals(request.getScheme(), this.mockRequest.getScheme());
|
||||
assertEquals(request.getServerName(), this.mockRequest.getServerName());
|
||||
assertEquals(request.getServerPort(), this.mockRequest.getServerPort());
|
||||
assertEquals(request.getServletPath(), this.mockRequest
|
||||
.getServletPath());
|
||||
.getServletPath());
|
||||
assertEquals(request.getSession(), this.mockRequest.getSession());
|
||||
assertEquals(request.getSession(false), this.mockRequest
|
||||
.getSession(false));
|
||||
.getSession(false));
|
||||
assertEquals(request.getUserPrincipal(), this.mockRequest
|
||||
.getUserPrincipal());
|
||||
.getUserPrincipal());
|
||||
assertEquals(request.isRequestedSessionIdFromCookie(), this.mockRequest
|
||||
.isRequestedSessionIdFromCookie());
|
||||
.isRequestedSessionIdFromCookie());
|
||||
assertEquals(request.isRequestedSessionIdFromUrl(), this.mockRequest
|
||||
.isRequestedSessionIdFromUrl());
|
||||
.isRequestedSessionIdFromUrl());
|
||||
assertEquals(request.isRequestedSessionIdFromURL(), this.mockRequest
|
||||
.isRequestedSessionIdFromURL());
|
||||
.isRequestedSessionIdFromURL());
|
||||
assertEquals(request.isRequestedSessionIdValid(), this.mockRequest
|
||||
.isRequestedSessionIdValid());
|
||||
.isRequestedSessionIdValid());
|
||||
assertEquals(request.isSecure(), this.mockRequest.isSecure());
|
||||
assertEquals(request.isUserInRole("test"), this.mockRequest
|
||||
.isUserInRole("test"));
|
||||
.isUserInRole("test"));
|
||||
assertEquals(request.getDateHeader("test"), this.mockRequest
|
||||
.getDateHeader("test"));
|
||||
.getDateHeader("test"));
|
||||
assertEquals(request.getHeader("test"), this.mockRequest
|
||||
.getHeader("test"));
|
||||
.getHeader("test"));
|
||||
assertEquals(request.getHeaders("test").hasMoreElements(),
|
||||
this.mockRequest.getHeaders("test").hasMoreElements());
|
||||
this.mockRequest.getHeaders("test").hasMoreElements());
|
||||
assertEquals(request.getIntHeader("test"), this.mockRequest
|
||||
.getIntHeader("test"));
|
||||
.getIntHeader("test"));
|
||||
|
||||
this.mockRequest.setAttribute("test", "test");
|
||||
|
||||
assertEquals(request.getAttribute("test"), this.mockRequest
|
||||
.getAttribute("test"));
|
||||
.getAttribute("test"));
|
||||
|
||||
this.mockRequest.removeAttribute("test");
|
||||
|
||||
assertEquals(request.getAttribute("test"), this.mockRequest
|
||||
.getAttribute("test"));
|
||||
.getAttribute("test"));
|
||||
assertEquals(request.getParameter("test"), this.mockRequest
|
||||
.getParameter("test"));
|
||||
.getParameter("test"));
|
||||
assertEquals(request.getParameterValues("test"), this.mockRequest
|
||||
.getParameterValues("test"));
|
||||
.getParameterValues("test"));
|
||||
assertEquals(request.getRealPath("test"), this.mockRequest
|
||||
.getRealPath("test"));
|
||||
.getRealPath("test"));
|
||||
assertEquals(request.getRequestDispatcher("test").getClass(),
|
||||
this.mockRequest.getRequestDispatcher("test").getClass());
|
||||
this.mockRequest.getRequestDispatcher("test").getClass());
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans>
|
||||
<bean id="proxyGrantingTicketStorage2"
|
||||
class="org.jasig.cas.client.proxy.ProxyGrantingTicketStorageImpl">
|
||||
</bean>
|
||||
<bean id="proxyGrantingTicketStorage2"
|
||||
class="org.jasig.cas.client.proxy.ProxyGrantingTicketStorageImpl">
|
||||
</bean>
|
||||
</beans>
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans>
|
||||
<bean id="proxyGrantingTicketStorage"
|
||||
class="org.jasig.cas.client.proxy.ProxyGrantingTicketStorageImpl">
|
||||
</bean>
|
||||
<bean id="proxyGrantingTicketStorage"
|
||||
class="org.jasig.cas.client.proxy.ProxyGrantingTicketStorageImpl">
|
||||
</bean>
|
||||
</beans>
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans>
|
||||
<bean id="proxyGrantingTicketStorage1"
|
||||
class="org.jasig.cas.client.proxy.ProxyGrantingTicketStorageImpl">
|
||||
</bean>
|
||||
|
||||
<bean id="proxyGrantingTicketStorage2"
|
||||
class="org.jasig.cas.client.proxy.ProxyGrantingTicketStorageImpl">
|
||||
</bean>
|
||||
<bean id="proxyGrantingTicketStorage1"
|
||||
class="org.jasig.cas.client.proxy.ProxyGrantingTicketStorageImpl">
|
||||
</bean>
|
||||
|
||||
<bean id="proxyGrantingTicketStorage2"
|
||||
class="org.jasig.cas.client.proxy.ProxyGrantingTicketStorageImpl">
|
||||
</bean>
|
||||
</beans>
|
||||
|
|
@ -161,5 +161,9 @@
|
|||
<orderEntry type="module" module-name="cas-client-core" />
|
||||
<orderEntryProperties />
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<option name="ACTIVE_VCS_NAME" value="CVS" />
|
||||
<option name="USE_PROJECT_VCS" value="false" />
|
||||
</component>
|
||||
</module>
|
||||
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@
|
|||
<version>3.0-rc1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<reporting>
|
||||
<reporting>
|
||||
<excludeDefaults>false</excludeDefaults>
|
||||
<plugins>
|
||||
<plugin>
|
||||
|
|
@ -102,8 +102,8 @@
|
|||
<artifactId>maven-jxr-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-report-plugin</artifactId>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-report-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
|
|
|
|||
|
|
@ -14,47 +14,58 @@ import org.jasig.portal.security.InitialSecurityContextFactory;
|
|||
import org.jasig.portal.spring.PortalApplicationContextFacade;
|
||||
|
||||
/**
|
||||
* Abstract implementation of a SecurityContextFactory that can load all the dependences if a
|
||||
* Abstract implementation of a SecurityContextFactory that can load all the dependences if a
|
||||
* CasSecurityCcontext.
|
||||
*
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
*
|
||||
*/
|
||||
public abstract class AbstractCasSecurityContextFactory extends
|
||||
InitialSecurityContextFactory {
|
||||
InitialSecurityContextFactory {
|
||||
|
||||
|
||||
/** Spring Bean ID for the Ticket Validator. */
|
||||
/**
|
||||
* Spring Bean ID for the Ticket Validator.
|
||||
*/
|
||||
public static final String CONST_CAS_TICKET_VALIDATOR = "casTicketValidator";
|
||||
|
||||
/** Spring Bean ID for the Proxy Retriever. */
|
||||
/**
|
||||
* Spring Bean ID for the Proxy Retriever.
|
||||
*/
|
||||
public static final String CONST_CAS_PROXY_RETRIEVER = "casProxyRetriever";
|
||||
|
||||
/** Spring Bean ID for the Service. */
|
||||
/**
|
||||
* Spring Bean ID for the Service.
|
||||
*/
|
||||
public static final String CONST_CAS_SERVICE = "casService";
|
||||
|
||||
/** Spring Bean ID for the ProxyGrantingTicketStorage. */
|
||||
/**
|
||||
* Spring Bean ID for the ProxyGrantingTicketStorage.
|
||||
*/
|
||||
public static final String CONST_CAS_PROXY_GRANTING_TICKET_STORAGE = "casProxyGrantingTicketStorage";
|
||||
|
||||
/** Instance of Commons Logging. */
|
||||
/**
|
||||
* Instance of Commons Logging.
|
||||
*/
|
||||
protected final Log log = LogFactory.getLog(this.getClass());
|
||||
|
||||
/**
|
||||
* The Ticket Validator referenced by the constant
|
||||
* <code>CONST_CAS_TICKET_VALIDATOR</code>.
|
||||
*/
|
||||
protected TicketValidator ticketValidator;
|
||||
protected final TicketValidator ticketValidator;
|
||||
|
||||
/**
|
||||
* The ProxyRetriever referenced by the constant
|
||||
* <code>CONST_CAS_PROXY_RETRIEVER</code>.
|
||||
*/
|
||||
protected ProxyRetriever proxyRetriever;
|
||||
protected final ProxyRetriever proxyRetriever;
|
||||
|
||||
/** The Service referenced by the constant <code>CONST_CAS_SERVICE</code>. */
|
||||
protected Service service;
|
||||
/**
|
||||
* The Service referenced by the constant <code>CONST_CAS_SERVICE</code>.
|
||||
*/
|
||||
protected final Service service;
|
||||
|
||||
/**
|
||||
* Default constructor retrieves and caches results from looking up entries
|
||||
|
|
@ -63,18 +74,19 @@ public abstract class AbstractCasSecurityContextFactory extends
|
|||
*/
|
||||
public AbstractCasSecurityContextFactory() {
|
||||
this.ticketValidator = (TicketValidator) PortalApplicationContextFacade
|
||||
.getPortalApplicationContext().getBean(CONST_CAS_TICKET_VALIDATOR);
|
||||
.getPortalApplicationContext().getBean(CONST_CAS_TICKET_VALIDATOR);
|
||||
if (PortalApplicationContextFacade.getPortalApplicationContext()
|
||||
.containsBean(CONST_CAS_PROXY_RETRIEVER)) {
|
||||
.containsBean(CONST_CAS_PROXY_RETRIEVER)) {
|
||||
this.proxyRetriever = (ProxyRetriever) PortalApplicationContextFacade
|
||||
.getPortalApplicationContext().getBean(
|
||||
.getPortalApplicationContext().getBean(
|
||||
CONST_CAS_PROXY_RETRIEVER);
|
||||
} else {
|
||||
this.proxyRetriever = null;
|
||||
log
|
||||
.warn("No Proxy Retriever found in PortalApplicationFacade. No Proxying capabilities will be provided by CAS.");
|
||||
.warn("No Proxy Retriever found in PortalApplicationFacade. No Proxying capabilities will be provided by CAS.");
|
||||
}
|
||||
this.service = (Service) PortalApplicationContextFacade
|
||||
.getPortalApplicationContext().getBean(CONST_CAS_SERVICE);
|
||||
.getPortalApplicationContext().getBean(CONST_CAS_SERVICE);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,21 +16,23 @@ import java.util.Enumeration;
|
|||
/**
|
||||
* Extension to LocalConnectionContext that will retrieve and append a proxy
|
||||
* ticket to a given descriptor.
|
||||
*
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
*/
|
||||
public final class CasConnectionContext extends LocalConnectionContext {
|
||||
|
||||
/** Instance of ICasSecurityContext. */
|
||||
/**
|
||||
* Instance of ICasSecurityContext.
|
||||
*/
|
||||
private ICasSecurityContext casSecurityContext;
|
||||
|
||||
public String getDescriptor(String descriptor,
|
||||
final ChannelRuntimeData channelRuntimeData) {
|
||||
final ChannelRuntimeData channelRuntimeData) {
|
||||
if (log.isTraceEnabled()) {
|
||||
log.trace("getDescriptor(" + descriptor + ", " + channelRuntimeData
|
||||
+ ")");
|
||||
+ ")");
|
||||
}
|
||||
|
||||
descriptor = descriptor == null ? "null" : descriptor;
|
||||
|
|
@ -39,11 +41,11 @@ public final class CasConnectionContext extends LocalConnectionContext {
|
|||
|
||||
if (this.casSecurityContext != null) {
|
||||
final String proxyTicket = this.casSecurityContext
|
||||
.getProxyTicket(new SimpleService(descriptor));
|
||||
.getProxyTicket(new SimpleService(descriptor));
|
||||
|
||||
if (proxyTicket != null) {
|
||||
// append ticket parameter and value to query string
|
||||
if (descriptor.indexOf("?") != -1) {
|
||||
if (descriptor.indexOf('?') != -1) {
|
||||
descriptor = descriptor + "&ticket=" + proxyTicket;
|
||||
} else {
|
||||
descriptor = descriptor + "?ticket=" + proxyTicket;
|
||||
|
|
@ -57,11 +59,11 @@ public final class CasConnectionContext extends LocalConnectionContext {
|
|||
|
||||
public void init(final ChannelStaticData channelStaticData) {
|
||||
final ISecurityContext securityContext = channelStaticData.getPerson()
|
||||
.getSecurityContext();
|
||||
.getSecurityContext();
|
||||
|
||||
if (ICasSecurityContext.class.isAssignableFrom(securityContext
|
||||
.getClass())
|
||||
&& securityContext.isAuthenticated()) {
|
||||
.getClass())
|
||||
&& securityContext.isAuthenticated()) {
|
||||
this.casSecurityContext = (ICasSecurityContext) securityContext;
|
||||
}
|
||||
|
||||
|
|
@ -69,10 +71,10 @@ public final class CasConnectionContext extends LocalConnectionContext {
|
|||
|
||||
while (enumeration.hasMoreElements()) {
|
||||
final ISecurityContext context = (ISecurityContext) enumeration
|
||||
.nextElement();
|
||||
.nextElement();
|
||||
|
||||
if (ISecurityContext.class.isAssignableFrom(context.getClass())
|
||||
&& context.isAuthenticated()) {
|
||||
&& context.isAuthenticated()) {
|
||||
this.casSecurityContext = (ICasSecurityContext) context;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,32 +17,45 @@ import org.jasig.portal.security.provider.ChainingSecurityContext;
|
|||
/**
|
||||
* Implementation of ICasSecurityContext that knows how to handle CAS ticket
|
||||
* validation, as well as the retrieval of Proxy Tickets.
|
||||
*
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
*/
|
||||
public class CasSecurityContext extends ChainingSecurityContext implements
|
||||
ICasSecurityContext {
|
||||
ICasSecurityContext {
|
||||
|
||||
/** Unique Id for Serialization */
|
||||
/**
|
||||
* Unique Id for Serialization
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** Instance of TicketValidator to validate tickets. */
|
||||
/**
|
||||
* Instance of TicketValidator to validate tickets.
|
||||
*/
|
||||
private final TicketValidator ticketValidator;
|
||||
|
||||
/** Instance of ProxyRetriever to obtain proxy tickets. */
|
||||
/**
|
||||
* Instance of ProxyRetriever to obtain proxy tickets.
|
||||
*/
|
||||
private final ProxyRetriever proxyRetriever;
|
||||
|
||||
/** Instance of Service representing uPortal instance. */
|
||||
/**
|
||||
* Instance of Service representing uPortal instance.
|
||||
*/
|
||||
private final Service service;
|
||||
|
||||
/** Assertion about the person this security context is for. */
|
||||
/**
|
||||
* Assertion about the person this security context is for.
|
||||
*/
|
||||
private Assertion assertion;
|
||||
|
||||
/**
|
||||
* Instantiate a new CasSecurityContext, setting the required fields.
|
||||
*
|
||||
* @param ticketValidator the TicketValidator to validate tickets.
|
||||
* @param service the Service representing the portal.
|
||||
* @param proxyRetriever the ProxyRetriever to use to retrieve proxies.
|
||||
*/
|
||||
public CasSecurityContext(final TicketValidator ticketValidator, final Service service, final ProxyRetriever proxyRetriever
|
||||
) {
|
||||
|
|
@ -55,14 +68,14 @@ public class CasSecurityContext extends ChainingSecurityContext implements
|
|||
this.proxyRetriever = proxyRetriever;
|
||||
}
|
||||
|
||||
public final String getProxyTicket(final Service service) {
|
||||
public final String getProxyTicket(final Service targetService) {
|
||||
if (this.proxyRetriever == null
|
||||
|| CommonUtils.isEmpty(this.assertion.getProxyGrantingTicketId())) {
|
||||
|| CommonUtils.isEmpty(this.assertion.getProxyGrantingTicketId())) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return this.proxyRetriever.getProxyTicketIdFor(this.assertion
|
||||
.getProxyGrantingTicketId(), service);
|
||||
.getProxyGrantingTicketId(), targetService);
|
||||
}
|
||||
|
||||
public final int getAuthType() {
|
||||
|
|
@ -72,17 +85,17 @@ public class CasSecurityContext extends ChainingSecurityContext implements
|
|||
public final synchronized void authenticate() throws PortalSecurityException {
|
||||
this.isauth = false;
|
||||
final String serviceTicket = new String(
|
||||
this.myOpaqueCredentials.credentialstring);
|
||||
this.myOpaqueCredentials.credentialstring);
|
||||
final Service service = getService();
|
||||
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Attempting to validate ticket [" + serviceTicket
|
||||
+ "] for service [" + service.toString());
|
||||
+ "] for service [" + service.toString());
|
||||
}
|
||||
|
||||
try {
|
||||
this.assertion = this.ticketValidator.validate(serviceTicket,
|
||||
service);
|
||||
service);
|
||||
this.myAdditionalDescriptor = null;
|
||||
this.myPrincipal.setUID(this.assertion.getPrincipal().getId());
|
||||
this.isauth = true;
|
||||
|
|
@ -92,7 +105,7 @@ public class CasSecurityContext extends ChainingSecurityContext implements
|
|||
throw new PortalSecurityException(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected Service getService() {
|
||||
return this.service;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import org.jasig.portal.security.ISecurityContextFactory;
|
|||
* Implementation of an {@link ISecurityContextFactory} that on creation will
|
||||
* retrieve references to Spring managed CAS client objects and pass them to all
|
||||
* new CasSecurityContexts that are created.
|
||||
*
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
|
|
@ -21,10 +21,12 @@ public final class CasSecurityContextFactory extends AbstractCasSecurityContextF
|
|||
|
||||
/**
|
||||
* Instantiate a new instance of CasSecurityContext.
|
||||
*
|
||||
* @return a new ISecurityContext instance, specifically an instance of CasSecurityContext.
|
||||
*/
|
||||
public ISecurityContext getSecurityContext() {
|
||||
log
|
||||
.trace("Returning CasSecurityContext from CasSecurityContextFactory.");
|
||||
.trace("Returning CasSecurityContext from CasSecurityContextFactory.");
|
||||
return new CasSecurityContext(this.ticketValidator, this.service, this.proxyRetriever
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,18 +11,21 @@ import org.jasig.cas.authentication.principal.Service;
|
|||
* Interface implemented by CAS security contexts. These implementations are
|
||||
* aware of proxying, and can retrieve a ticket from CAS for accessing a
|
||||
* specific service.
|
||||
*
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
*/
|
||||
public interface ICasSecurityContext {
|
||||
|
||||
/** Authentication type for CAS authentication */
|
||||
/**
|
||||
* Authentication type for CAS authentication
|
||||
*/
|
||||
public static final int CAS_AUTHTYPE = 0x1701;
|
||||
|
||||
/** Retrieve a Proxy Ticket Id for a particular service we wish to proxy against.
|
||||
*
|
||||
/**
|
||||
* Retrieve a Proxy Ticket Id for a particular service we wish to proxy against.
|
||||
*
|
||||
* @param service the service to retrieve a proxy ticket for.
|
||||
* @return the ticket id, or null if no ticket could be retrieved.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -14,27 +14,29 @@ import org.jasig.cas.client.validation.TicketValidator;
|
|||
* ServiceHolder ThreadLocal object. This allows for a more flexible service to
|
||||
* be provided for ticket validation. This is needed as the normal
|
||||
* ISecurityContext has no mechanism for service urls based on requests.
|
||||
*
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
*/
|
||||
public final class ThreadLocalAwareCasSecurityContext extends
|
||||
CasSecurityContext {
|
||||
CasSecurityContext {
|
||||
|
||||
/** Unique Id for Serialization. */
|
||||
/**
|
||||
* Unique Id for Serialization.
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* Instantiate a new CasSecurityContext, setting the required fields.
|
||||
*
|
||||
*
|
||||
* @param ticketValidator the Ticket Validator.
|
||||
* @param service the Service instance representing this uPortal instance.
|
||||
* @param proxyRetriever the object used to retrieve proxies.
|
||||
* @param service the Service instance representing this uPortal instance.
|
||||
* @param proxyRetriever the object used to retrieve proxies.
|
||||
*/
|
||||
public ThreadLocalAwareCasSecurityContext(
|
||||
final TicketValidator ticketValidator, final Service service,
|
||||
final ProxyRetriever proxyRetriever) {
|
||||
final TicketValidator ticketValidator, final Service service,
|
||||
final ProxyRetriever proxyRetriever) {
|
||||
super(ticketValidator, service, proxyRetriever);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,16 +9,16 @@ import org.jasig.portal.security.ISecurityContext;
|
|||
|
||||
/**
|
||||
* Factory to instantiate ThreadLocalAwareCasSecurityContexts.
|
||||
*
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
*/
|
||||
public final class ThreadLocalAwareCasSecurityContextFactory extends
|
||||
AbstractCasSecurityContextFactory {
|
||||
AbstractCasSecurityContextFactory {
|
||||
|
||||
public ISecurityContext getSecurityContext() {
|
||||
return new ThreadLocalAwareCasSecurityContext(this.ticketValidator,
|
||||
this.service, this.proxyRetriever);
|
||||
this.service, this.proxyRetriever);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,22 +22,31 @@ import java.io.IOException;
|
|||
* {@link ThreadLocalAwareCasSecurityContext} in order to use it for Ticket
|
||||
* validation.
|
||||
* <p>This filter places the Service in a {@link ServiceHolder}.
|
||||
*
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
*/
|
||||
public final class ThreadLocalAwareCasServiceFilter extends AbstractCasFilter {
|
||||
|
||||
|
||||
public ThreadLocalAwareCasServiceFilter(final String serverName, final String serviceUrl) {
|
||||
super(serverName, serviceUrl);
|
||||
}
|
||||
|
||||
public ThreadLocalAwareCasServiceFilter(final String serverName, final String serviceUrl, final boolean useSession) {
|
||||
super(serverName, serviceUrl, useSession);
|
||||
}
|
||||
|
||||
protected void doFilterInternal(final HttpServletRequest request,
|
||||
final HttpServletResponse response, final FilterChain filterChain)
|
||||
throws IOException, ServletException {
|
||||
final HttpServletResponse response, final FilterChain filterChain)
|
||||
throws IOException, ServletException {
|
||||
final boolean hasTicket = CommonUtils.isNotBlank(request
|
||||
.getParameter("ticket"));
|
||||
.getParameter(AbstractCasFilter.PARAM_TICKET));
|
||||
try {
|
||||
if (hasTicket) {
|
||||
final Service service = new SimpleService(constructServiceUrl(
|
||||
request, response));
|
||||
request, response));
|
||||
ServiceHolder.setService(service);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,22 +16,24 @@ import javax.servlet.ServletException;
|
|||
* Implementation of AbstractProxyReceptorServlet that retrieves the
|
||||
* ProxyGrantingTicket storage from the Portal Application Context instead of a
|
||||
* WebApplicationContext.
|
||||
*
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
*/
|
||||
public final class UPortalConfiguredProxyReceptorServlet extends
|
||||
AbstractProxyReceptorServlet {
|
||||
AbstractProxyReceptorServlet {
|
||||
|
||||
/** Unique Id for Serialization. */
|
||||
/**
|
||||
* Unique Id for Serialization.
|
||||
*/
|
||||
private static final long serialVersionUID = 6596608588362834646L;
|
||||
|
||||
public void init(final ServletConfig servletConfig) throws ServletException {
|
||||
logger.info("Retrieving ProxyGrantingTicketStorage from PortalApplicationContextFacade.");
|
||||
setProxyGrantingTicketStorage((ProxyGrantingTicketStorage) PortalApplicationContextFacade
|
||||
.getPortalApplicationContext()
|
||||
.getBean(
|
||||
AbstractCasSecurityContextFactory.CONST_CAS_PROXY_GRANTING_TICKET_STORAGE));
|
||||
.getPortalApplicationContext()
|
||||
.getBean(
|
||||
AbstractCasSecurityContextFactory.CONST_CAS_PROXY_GRANTING_TICKET_STORAGE));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,72 +2,65 @@
|
|||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans>
|
||||
|
||||
<bean
|
||||
id="propertyPlaceholderConfigurer"
|
||||
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
|
||||
<property
|
||||
name="location"
|
||||
value="/WEB-INF/properties/cas-client.properties" />
|
||||
</bean>
|
||||
<bean
|
||||
id="propertyPlaceholderConfigurer"
|
||||
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
|
||||
<property
|
||||
name="location"
|
||||
value="/WEB-INF/properties/cas-client.properties"/>
|
||||
</bean>
|
||||
|
||||
<bean
|
||||
id="casTicketValidator"
|
||||
class="org.jasig.cas.client.validation.Cas20ServiceTicketValidator"
|
||||
init-method="init">
|
||||
<property
|
||||
name="proxyCallbackUrl"
|
||||
value="${cas.server.proxyCallbackUrl}" />
|
||||
<property
|
||||
name="proxyGrantingTicketStorage"
|
||||
ref="casProxyGrantingTicketStorage" />
|
||||
<property
|
||||
name="casServerUrl"
|
||||
value="${cas.server.url}" />
|
||||
<property
|
||||
name="httpClient"
|
||||
ref="httpClient" />
|
||||
</bean>
|
||||
<bean
|
||||
id="casTicketValidator"
|
||||
class="org.jasig.cas.client.validation.Cas20ServiceTicketValidator">
|
||||
<constructor-arg index="0" value="${cas.server.url}"/>
|
||||
<constructor-arg index="1" value="false"/>
|
||||
<constructor-arg index="2" ref="httpClient"/>
|
||||
<constructor-arg index="3">
|
||||
<bean
|
||||
class="org.jasig.cas.authentication.principal.SimpleService">
|
||||
<constructor-arg value="${cas.server.proxyCallbackUrl}"/>
|
||||
</bean>
|
||||
|
||||
<bean
|
||||
id="casProxyGrantingTicketStorage"
|
||||
class="org.jasig.cas.client.proxy.ProxyGrantingTicketStorageImpl"
|
||||
init-method="init" />
|
||||
</constructor-arg>
|
||||
<constructor-arg index="4" ref="casProxyGrantingTicketStorage"/>
|
||||
</bean>
|
||||
|
||||
<bean
|
||||
id="casProxyReceiver"
|
||||
class="org.jasig.cas.client.proxy.Cas20ProxyRetriever"
|
||||
init-method="init">
|
||||
<property
|
||||
name="casServerUrl"
|
||||
value="${cas.server.url}" />
|
||||
<property
|
||||
name="httpClient"
|
||||
ref="httpClient" />
|
||||
</bean>
|
||||
<bean
|
||||
id="casProxyGrantingTicketStorage"
|
||||
class="org.jasig.cas.client.proxy.ProxyGrantingTicketStorageImpl"/>
|
||||
|
||||
<bean
|
||||
id="httpClient"
|
||||
class="org.jasig.cas.util.HttpClient3FactoryBean">
|
||||
<property
|
||||
name="soTimeout"
|
||||
value="5000" />
|
||||
<property
|
||||
name="connectionTimeout"
|
||||
value="5000" />
|
||||
<property
|
||||
name="connectionManagerTimeout"
|
||||
value="5000" />
|
||||
<property
|
||||
name="defaultMaxConnectionsPerHost"
|
||||
value="10" />
|
||||
<property
|
||||
name="maxTotalConnections"
|
||||
value="10" />
|
||||
</bean>
|
||||
|
||||
<bean
|
||||
id="casService"
|
||||
class="org.jasig.cas.authentication.principal.SimpleService">
|
||||
<constructor-arg value="https://localhost:8443/portal/Authentication" />
|
||||
</bean>
|
||||
|
||||
<bean
|
||||
id="casProxyReceiver"
|
||||
class="org.jasig.cas.client.proxy.Cas20ProxyRetriever">
|
||||
<constructor-arg value="${cas.server.url}"/>
|
||||
<constructor-arg ref="httpClient"/>
|
||||
</bean>
|
||||
|
||||
<bean
|
||||
id="httpClient"
|
||||
class="org.jasig.cas.util.HttpClient3FactoryBean">
|
||||
<property
|
||||
name="soTimeout"
|
||||
value="5000"/>
|
||||
<property
|
||||
name="connectionTimeout"
|
||||
value="5000"/>
|
||||
<property
|
||||
name="connectionManagerTimeout"
|
||||
value="5000"/>
|
||||
<property
|
||||
name="defaultMaxConnectionsPerHost"
|
||||
value="10"/>
|
||||
<property
|
||||
name="maxTotalConnections"
|
||||
value="10"/>
|
||||
</bean>
|
||||
|
||||
<bean
|
||||
id="casService"
|
||||
class="org.jasig.cas.authentication.principal.SimpleService">
|
||||
<constructor-arg value="https://localhost:8443/portal/Authentication"/>
|
||||
</bean>
|
||||
</beans>
|
||||
|
|
@ -8,7 +8,7 @@ import org.jasig.portal.security.ISecurityContext;
|
|||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
*/
|
||||
public class CasSecurityContextFactoryTests extends TestCase {
|
||||
public final class CasSecurityContextFactoryTests extends TestCase {
|
||||
|
||||
private CasSecurityContextFactory casSecurityContextFactory;
|
||||
|
||||
|
|
|
|||
|
|
@ -4,11 +4,11 @@ import junit.framework.TestCase;
|
|||
import org.jasig.cas.authentication.principal.Service;
|
||||
import org.jasig.cas.authentication.principal.SimplePrincipal;
|
||||
import org.jasig.cas.authentication.principal.SimpleService;
|
||||
import org.jasig.cas.client.proxy.ProxyRetriever;
|
||||
import org.jasig.cas.client.validation.Assertion;
|
||||
import org.jasig.cas.client.validation.AssertionImpl;
|
||||
import org.jasig.cas.client.validation.TicketValidator;
|
||||
import org.jasig.cas.client.validation.ValidationException;
|
||||
import org.jasig.cas.client.proxy.ProxyRetriever;
|
||||
import org.jasig.portal.security.PortalSecurityException;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
|
@ -18,7 +18,7 @@ import java.util.HashMap;
|
|||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
*/
|
||||
public class CasSecurityContextTests extends TestCase {
|
||||
public final class CasSecurityContextTests extends TestCase {
|
||||
|
||||
private CasSecurityContext context;
|
||||
|
||||
|
|
|
|||
|
|
@ -8,9 +8,8 @@ import org.jasig.cas.authentication.principal.SimpleService;
|
|||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Datet$
|
||||
* @since 3.0
|
||||
*
|
||||
*/
|
||||
public class ServiceHolderTests extends TestCase {
|
||||
public final class ServiceHolderTests extends TestCase {
|
||||
|
||||
public void testSetGetService() {
|
||||
final Service service = new SimpleService("test");
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import org.jasig.portal.security.ISecurityContext;
|
|||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
*/
|
||||
public class ThreadLocalAwareCasSecurityContextFactoryTests extends TestCase {
|
||||
public final class ThreadLocalAwareCasSecurityContextFactoryTests extends TestCase {
|
||||
|
||||
private ThreadLocalAwareCasSecurityContextFactory factory;
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import org.jasig.cas.authentication.principal.SimpleService;
|
|||
/**
|
||||
* @author Scott
|
||||
*/
|
||||
public class ThreadLocalAwareCasSecurityContextTests extends TestCase {
|
||||
public final class ThreadLocalAwareCasSecurityContextTests extends TestCase {
|
||||
|
||||
private ThreadLocalAwareCasSecurityContext context;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
package org.jasig.cas.client.integration.uportal;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
import org.jasig.cas.authentication.principal.SimpleService;
|
||||
import org.springframework.mock.web.MockHttpServletRequest;
|
||||
import org.springframework.mock.web.MockHttpServletResponse;
|
||||
import org.jasig.cas.authentication.principal.SimpleService;
|
||||
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.ServletException;
|
||||
|
|
@ -16,15 +16,13 @@ import java.io.IOException;
|
|||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
*/
|
||||
public class ThreadLocalAwareCasServiceFilterTests extends TestCase {
|
||||
public final class ThreadLocalAwareCasServiceFilterTests extends TestCase {
|
||||
|
||||
private ThreadLocalAwareCasServiceFilter filter;
|
||||
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
this.filter = new ThreadLocalAwareCasServiceFilter();
|
||||
this.filter.setServiceUrl("http://localhost");
|
||||
this.filter.init();
|
||||
this.filter = new ThreadLocalAwareCasServiceFilter(null, "http://localhost");
|
||||
}
|
||||
|
||||
public void testServiceSetter() throws IOException, ServletException {
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
package org.jasig.cas.client.integration.uportal;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
import org.springframework.mock.web.MockServletContext;
|
||||
import org.springframework.mock.web.MockServletConfig;
|
||||
import org.springframework.mock.web.MockServletContext;
|
||||
|
||||
/**
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
*/
|
||||
public class UPortalConfiguredProxyReceptorServletTests extends TestCase {
|
||||
public final class UPortalConfiguredProxyReceptorServletTests extends TestCase {
|
||||
|
||||
public void testInitialization() throws Exception {
|
||||
final UPortalConfiguredProxyReceptorServlet servlet = new UPortalConfiguredProxyReceptorServlet();
|
||||
|
|
|
|||
|
|
@ -1,64 +1,58 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans>
|
||||
<bean
|
||||
id="casTicketValidator"
|
||||
class="org.jasig.cas.client.validation.Cas20ServiceTicketValidator"
|
||||
init-method="init">
|
||||
<property
|
||||
name="proxyCallbackUrl"
|
||||
value="https://localhost:8443/portal/ProxyCallbackUrl" />
|
||||
<property
|
||||
name="proxyGrantingTicketStorage"
|
||||
ref="casProxyGrantingTicketStorage" />
|
||||
<property
|
||||
name="casServerUrl"
|
||||
value="https://localhost:8443/cas/" />
|
||||
<property
|
||||
name="httpClient"
|
||||
ref="httpClient" />
|
||||
</bean>
|
||||
|
||||
<bean
|
||||
id="casProxyGrantingTicketStorage"
|
||||
class="org.jasig.cas.client.proxy.ProxyGrantingTicketStorageImpl"
|
||||
init-method="init" />
|
||||
<bean
|
||||
id="casTicketValidator"
|
||||
class="org.jasig.cas.client.validation.Cas20ServiceTicketValidator">
|
||||
<constructor-arg index="0" value="https://localhost:8443/cas/"/>
|
||||
<constructor-arg index="1" value="false"/>
|
||||
<constructor-arg index="2" ref="httpClient"/>
|
||||
<constructor-arg index="3">
|
||||
<bean
|
||||
class="org.jasig.cas.authentication.principal.SimpleService">
|
||||
<constructor-arg value="https://localhost:8443/portal/Proxy"/>
|
||||
</bean>
|
||||
|
||||
<bean
|
||||
id="casProxyReceiver"
|
||||
class="org.jasig.cas.client.proxy.Cas20ProxyRetriever"
|
||||
init-method="init">
|
||||
<property
|
||||
name="casServerUrl"
|
||||
value="https://localhost:8443/cas/" />
|
||||
<property
|
||||
name="httpClient"
|
||||
ref="httpClient" />
|
||||
</bean>
|
||||
</constructor-arg>
|
||||
<constructor-arg index="4" ref="casProxyGrantingTicketStorage"/>
|
||||
</bean>
|
||||
|
||||
<bean
|
||||
id="httpClient"
|
||||
class="org.jasig.cas.util.HttpClient3FactoryBean">
|
||||
<property
|
||||
name="soTimeout"
|
||||
value="5000" />
|
||||
<property
|
||||
name="connectionTimeout"
|
||||
value="5000" />
|
||||
<property
|
||||
name="connectionManagerTimeout"
|
||||
value="5000" />
|
||||
<property
|
||||
name="defaultMaxConnectionsPerHost"
|
||||
value="10" />
|
||||
<property
|
||||
name="maxTotalConnections"
|
||||
value="10" />
|
||||
</bean>
|
||||
<bean
|
||||
id="casProxyGrantingTicketStorage"
|
||||
class="org.jasig.cas.client.proxy.ProxyGrantingTicketStorageImpl"/>
|
||||
|
||||
<bean
|
||||
id="casService"
|
||||
class="org.jasig.cas.authentication.principal.SimpleService">
|
||||
<constructor-arg value="https://localhost:8443/portal/Authentication" />
|
||||
</bean>
|
||||
|
||||
<bean
|
||||
id="casProxyReceiver"
|
||||
class="org.jasig.cas.client.proxy.Cas20ProxyRetriever">
|
||||
<constructor-arg value="https://localhost:8443/cas/"/>
|
||||
<constructor-arg ref="httpClient"/>
|
||||
</bean>
|
||||
|
||||
<bean
|
||||
id="httpClient"
|
||||
class="org.jasig.cas.util.HttpClient3FactoryBean">
|
||||
<property
|
||||
name="soTimeout"
|
||||
value="5000"/>
|
||||
<property
|
||||
name="connectionTimeout"
|
||||
value="5000"/>
|
||||
<property
|
||||
name="connectionManagerTimeout"
|
||||
value="5000"/>
|
||||
<property
|
||||
name="defaultMaxConnectionsPerHost"
|
||||
value="10"/>
|
||||
<property
|
||||
name="maxTotalConnections"
|
||||
value="10"/>
|
||||
</bean>
|
||||
|
||||
<bean
|
||||
id="casService"
|
||||
class="org.jasig.cas.authentication.principal.SimpleService">
|
||||
<constructor-arg value="https://localhost:8443/portal/Authentication"/>
|
||||
</bean>
|
||||
</beans>
|
||||
353
cas-client.iws
353
cas-client.iws
|
|
@ -18,7 +18,84 @@
|
|||
<option name="USER" value="" />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" name="Default" comment="" />
|
||||
<list default="true" name="Default" comment="">
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/util/FilterToBeanProxy.java" afterPath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/util/FilterToBeanProxy.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/test/java/org/jasig/cas/client/validation/Cas10TicketValidatorTests.java" afterPath="$PROJECT_DIR$/cas-client-core/src/test/java/org/jasig/cas/client/validation/Cas10TicketValidatorTests.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-uportal/src/test/resources/properties/uPortalConfigContext.xml" afterPath="$PROJECT_DIR$/cas-client-uportal/src/test/resources/properties/uPortalConfigContext.xml" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/test/java/org/jasig/cas/client/authorization/DefaultCasAuthorizedDeciderImplTests.java" afterPath="$PROJECT_DIR$/cas-client-core/src/test/java/org/jasig/cas/client/authorization/DefaultCasAuthorizedDeciderImplTests.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/test/java/org/jasig/cas/client/web/filter/CasAuthorizationFilterTests.java" afterPath="$PROJECT_DIR$/cas-client-core/src/test/java/org/jasig/cas/client/web/filter/CasAuthorizationFilterTests.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/web/filter/HttpServletRequestWrapperFilter.java" afterPath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/web/filter/HttpServletRequestWrapperFilter.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/proxy/Cas20ProxyRetriever.java" afterPath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/proxy/Cas20ProxyRetriever.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-uportal/src/test/java/org/jasig/cas/client/integration/uportal/ThreadLocalAwareCasSecurityContextFactoryTests.java" afterPath="$PROJECT_DIR$/cas-client-uportal/src/test/java/org/jasig/cas/client/integration/uportal/ThreadLocalAwareCasSecurityContextFactoryTests.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/authorization/DefaultCasAuthorizedDeciderImpl.java" afterPath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/authorization/DefaultCasAuthorizedDeciderImpl.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/main/resources/web-simple-example.xml" afterPath="$PROJECT_DIR$/cas-client-core/src/main/resources/web-simple-example.xml" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-uportal/src/test/java/org/jasig/cas/client/integration/uportal/CasSecurityContextFactoryTests.java" afterPath="$PROJECT_DIR$/cas-client-uportal/src/test/java/org/jasig/cas/client/integration/uportal/CasSecurityContextFactoryTests.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/test/java/org/jasig/cas/client/proxy/ProxyGrantingTicketStorageImplTests.java" afterPath="$PROJECT_DIR$/cas-client-core/src/test/java/org/jasig/cas/client/proxy/ProxyGrantingTicketStorageImplTests.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/web/filter/CasAuthorizationFilter.java" afterPath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/web/filter/CasAuthorizationFilter.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/test/resources/oneProxyGrantingTicketStorageConfig.xml" afterPath="$PROJECT_DIR$/cas-client-core/src/test/resources/oneProxyGrantingTicketStorageConfig.xml" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/test/java/org/jasig/cas/client/validation/AssertionImplTests.java" afterPath="$PROJECT_DIR$/cas-client-core/src/test/java/org/jasig/cas/client/validation/AssertionImplTests.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/validation/InvalidProxyChainValidationException.java" afterPath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/validation/InvalidProxyChainValidationException.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/validation/TicketValidator.java" afterPath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/validation/TicketValidator.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-uportal/src/main/java/org/jasig/cas/client/integration/uportal/CasSecurityContext.java" afterPath="$PROJECT_DIR$/cas-client-uportal/src/main/java/org/jasig/cas/client/integration/uportal/CasSecurityContext.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/util/XmlUtils.java" afterPath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/util/XmlUtils.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/authorization/package.html" afterPath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/authorization/package.html" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/test/java/org/jasig/cas/client/PublicTestHttpServer.java" afterPath="$PROJECT_DIR$/cas-client-core/src/test/java/org/jasig/cas/client/PublicTestHttpServer.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/proxy/SpringConfiguredProxyReceptorServlet.java" afterPath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/proxy/SpringConfiguredProxyReceptorServlet.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-uportal/src/main/java/org/jasig/cas/client/integration/uportal/AbstractCasSecurityContextFactory.java" afterPath="$PROJECT_DIR$/cas-client-uportal/src/main/java/org/jasig/cas/client/integration/uportal/AbstractCasSecurityContextFactory.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/test/java/org/jasig/cas/client/util/DelegatingFilterTests.java" afterPath="$PROJECT_DIR$/cas-client-core/src/test/java/org/jasig/cas/client/util/DelegatingFilterTests.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client.iws" afterPath="$PROJECT_DIR$/cas-client.iws" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-uportal/src/main/java/org/jasig/cas/client/integration/uportal/ThreadLocalAwareCasServiceFilter.java" afterPath="$PROJECT_DIR$/cas-client-uportal/src/main/java/org/jasig/cas/client/integration/uportal/ThreadLocalAwareCasServiceFilter.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/web/filter/CasAuthenticationFilter.java" afterPath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/web/filter/CasAuthenticationFilter.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/validation/Cas10TicketValidator.java" afterPath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/validation/Cas10TicketValidator.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-uportal/src/test/java/org/jasig/cas/client/integration/uportal/CasSecurityContextTests.java" afterPath="$PROJECT_DIR$/cas-client-uportal/src/test/java/org/jasig/cas/client/integration/uportal/CasSecurityContextTests.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/test/resources/proxyGrantingTicketStorageConfig.xml" afterPath="$PROJECT_DIR$/cas-client-core/src/test/resources/proxyGrantingTicketStorageConfig.xml" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/proxy/ProxyRetriever.java" afterPath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/proxy/ProxyRetriever.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/authorization/AuthorizationException.java" afterPath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/authorization/AuthorizationException.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-uportal/src/main/java/org/jasig/cas/client/integration/uportal/CasSecurityContextFactory.java" afterPath="$PROJECT_DIR$/cas-client-uportal/src/main/java/org/jasig/cas/client/integration/uportal/CasSecurityContextFactory.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-uportal/src/main/java/org/jasig/cas/client/integration/uportal/ICasSecurityContext.java" afterPath="$PROJECT_DIR$/cas-client-uportal/src/main/java/org/jasig/cas/client/integration/uportal/ICasSecurityContext.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-uportal/src/main/java/org/jasig/cas/client/integration/uportal/ThreadLocalAwareCasSecurityContext.java" afterPath="$PROJECT_DIR$/cas-client-uportal/src/main/java/org/jasig/cas/client/integration/uportal/ThreadLocalAwareCasSecurityContext.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/test/java/org/jasig/cas/client/web/filter/CasAuthenticationFilterTests.java" afterPath="$PROJECT_DIR$/cas-client-core/src/test/java/org/jasig/cas/client/web/filter/CasAuthenticationFilterTests.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/settings.xml" afterPath="$PROJECT_DIR$/cas-client-core/settings.xml" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/test/java/org/jasig/cas/client/web/filter/CasValidationFilterTests.java" afterPath="$PROJECT_DIR$/cas-client-core/src/test/java/org/jasig/cas/client/web/filter/CasValidationFilterTests.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/test/java/org/jasig/cas/client/authorization/AuthorizationExceptionTests.java" afterPath="$PROJECT_DIR$/cas-client-core/src/test/java/org/jasig/cas/client/authorization/AuthorizationExceptionTests.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/authorization/CasAuthorizedDecider.java" afterPath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/authorization/CasAuthorizedDecider.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/validation/Cas20ProxyTicketValidator.java" afterPath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/validation/Cas20ProxyTicketValidator.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-uportal/src/main/java/org/jasig/cas/client/integration/uportal/CasConnectionContext.java" afterPath="$PROJECT_DIR$/cas-client-uportal/src/main/java/org/jasig/cas/client/integration/uportal/CasConnectionContext.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/test/resources/twoProxyGrantingTicketStorageConfig.xml" afterPath="$PROJECT_DIR$/cas-client-core/src/test/resources/twoProxyGrantingTicketStorageConfig.xml" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-uportal/src/test/java/org/jasig/cas/client/integration/uportal/UPortalConfiguredProxyReceptorServletTests.java" afterPath="$PROJECT_DIR$/cas-client-uportal/src/test/java/org/jasig/cas/client/integration/uportal/UPortalConfiguredProxyReceptorServletTests.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/main/resources/simpleFilterExample.xml" afterPath="$PROJECT_DIR$/cas-client-core/src/main/resources/simpleFilterExample.xml" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-uportal/src/test/java/org/jasig/cas/client/integration/uportal/ServiceHolderTests.java" afterPath="$PROJECT_DIR$/cas-client-uportal/src/test/java/org/jasig/cas/client/integration/uportal/ServiceHolderTests.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/util/CommonUtils.java" afterPath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/util/CommonUtils.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/proxy/ProxyGrantingTicketStorageImpl.java" afterPath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/proxy/ProxyGrantingTicketStorageImpl.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/test/java/org/jasig/cas/client/validation/Cas20ProxyTicketValidatorTests.java" afterPath="$PROJECT_DIR$/cas-client-core/src/test/java/org/jasig/cas/client/validation/Cas20ProxyTicketValidatorTests.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/proxy/ProxyGrantingTicketStorage.java" afterPath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/proxy/ProxyGrantingTicketStorage.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-uportal/src/main/java/org/jasig/cas/client/integration/uportal/ThreadLocalAwareCasSecurityContextFactory.java" afterPath="$PROJECT_DIR$/cas-client-uportal/src/main/java/org/jasig/cas/client/integration/uportal/ThreadLocalAwareCasSecurityContextFactory.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/web/filter/CasValidationFilter.java" afterPath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/web/filter/CasValidationFilter.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/test/java/org/jasig/cas/client/validation/AbstractTicketValidatorTests.java" afterPath="$PROJECT_DIR$/cas-client-core/src/test/java/org/jasig/cas/client/validation/AbstractTicketValidatorTests.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/proxy/package.html" afterPath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/proxy/package.html" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/validation/Assertion.java" afterPath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/validation/Assertion.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/web/filter/package.html" afterPath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/web/filter/package.html" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/web/filter/AbstractCasFilter.java" afterPath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/web/filter/AbstractCasFilter.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/test/java/org/jasig/cas/client/util/CommonUtilsTests.java" afterPath="$PROJECT_DIR$/cas-client-core/src/test/java/org/jasig/cas/client/util/CommonUtilsTests.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/test/java/org/jasig/cas/client/validation/Cas20ServiceTicketValidatorTests.java" afterPath="$PROJECT_DIR$/cas-client-core/src/test/java/org/jasig/cas/client/validation/Cas20ServiceTicketValidatorTests.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/proxy/AbstractProxyReceptorServlet.java" afterPath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/proxy/AbstractProxyReceptorServlet.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-uportal/src/main/java/org/jasig/cas/client/integration/uportal/UPortalConfiguredProxyReceptorServlet.java" afterPath="$PROJECT_DIR$/cas-client-uportal/src/main/java/org/jasig/cas/client/integration/uportal/UPortalConfiguredProxyReceptorServlet.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-uportal/src/main/resources/uportalCasConfigurationContext.xml" afterPath="$PROJECT_DIR$/cas-client-uportal/src/main/resources/uportalCasConfigurationContext.xml" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-uportal/cas-client-uportal.iml" afterPath="$PROJECT_DIR$/cas-client-uportal/cas-client-uportal.iml" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-uportal/pom.xml" afterPath="$PROJECT_DIR$/cas-client-uportal/pom.xml" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/test/java/org/jasig/cas/client/proxy/AbstractProxyGrantingTicketStorageTests.java" afterPath="$PROJECT_DIR$/cas-client-core/src/test/java/org/jasig/cas/client/proxy/AbstractProxyGrantingTicketStorageTests.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/validation/AbstractUrlBasedTicketValidator.java" afterPath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/validation/AbstractUrlBasedTicketValidator.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/test/java/org/jasig/cas/client/authorization/AbstractCasAuthorizedDeciderTests.java" afterPath="$PROJECT_DIR$/cas-client-core/src/test/java/org/jasig/cas/client/authorization/AbstractCasAuthorizedDeciderTests.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/validation/Cas20ServiceTicketValidator.java" afterPath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/validation/Cas20ServiceTicketValidator.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/validation/AssertionImpl.java" afterPath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/validation/AssertionImpl.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/test/java/org/jasig/cas/client/proxy/SpringConfiguredProxyReceptorServletTests.java" afterPath="$PROJECT_DIR$/cas-client-core/src/test/java/org/jasig/cas/client/proxy/SpringConfiguredProxyReceptorServletTests.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/test/java/org/jasig/cas/client/web/filter/HttpServletRequestWrapperFilterTests.java" afterPath="$PROJECT_DIR$/cas-client-core/src/test/java/org/jasig/cas/client/web/filter/HttpServletRequestWrapperFilterTests.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/cas-client-core.iml" afterPath="$PROJECT_DIR$/cas-client-core/cas-client-core.iml" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/util/DelegatingFilter.java" afterPath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/util/DelegatingFilter.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/validation/ValidationException.java" afterPath="$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/validation/ValidationException.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-uportal/src/test/java/org/jasig/cas/client/integration/uportal/ThreadLocalAwareCasServiceFilterTests.java" afterPath="$PROJECT_DIR$/cas-client-uportal/src/test/java/org/jasig/cas/client/integration/uportal/ThreadLocalAwareCasServiceFilterTests.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cas-client-uportal/src/test/java/org/jasig/cas/client/integration/uportal/ThreadLocalAwareCasSecurityContextTests.java" afterPath="$PROJECT_DIR$/cas-client-uportal/src/test/java/org/jasig/cas/client/integration/uportal/ThreadLocalAwareCasSecurityContextTests.java" />
|
||||
</list>
|
||||
</component>
|
||||
<component name="ChangeListSynchronizer" />
|
||||
<component name="ChangesViewManager" flattened_view="false" />
|
||||
|
|
@ -29,7 +106,7 @@
|
|||
<splitter proportion="0.5" />
|
||||
</component>
|
||||
<component name="CompilerWorkspaceConfiguration">
|
||||
<option name="COMPILE_IN_BACKGROUND" value="false" />
|
||||
<option name="COMPILE_IN_BACKGROUND" value="true" />
|
||||
<option name="AUTO_SHOW_ERRORS_IN_EDITOR" value="true" />
|
||||
<option name="CLOSE_MESSAGE_VIEW_IF_SUCCESS" value="true" />
|
||||
<option name="COMPILE_DEPENDENT_FILES" value="false" />
|
||||
|
|
@ -217,7 +294,7 @@
|
|||
<option name="SPLITTER_PROPORTION" value="0.5" />
|
||||
<option name="GROUP_BY_SEVERITY" value="false" />
|
||||
<option name="FILTER_RESOLVED_ITEMS" value="true" />
|
||||
<option name="ANALYZE_TEST_SOURCES" value="true" />
|
||||
<option name="ANALYZE_TEST_SOURCES" value="false" />
|
||||
<option name="SHOW_DIFF_WITH_PREVIOUS_RUN" value="false" />
|
||||
<option name="SCOPE_TYPE" value="1" />
|
||||
<option name="CUSTOM_SCOPE_NAME" value="Project Files" />
|
||||
|
|
@ -352,46 +429,6 @@
|
|||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
||||
</PATH_ELEMENT>
|
||||
</PATH>
|
||||
<PATH>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="cas-client.ipr" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
||||
</PATH_ELEMENT>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="cas-client-uportal" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
|
||||
</PATH_ELEMENT>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="PsiDirectory:C:\idea-workspace\java-client\cas-client-uportal" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
||||
</PATH_ELEMENT>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="PsiDirectory:C:\idea-workspace\java-client\cas-client-uportal\src" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
||||
</PATH_ELEMENT>
|
||||
</PATH>
|
||||
<PATH>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="cas-client.ipr" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
||||
</PATH_ELEMENT>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="cas-client-uportal" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
|
||||
</PATH_ELEMENT>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="PsiDirectory:C:\idea-workspace\java-client\cas-client-uportal" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
||||
</PATH_ELEMENT>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="PsiDirectory:C:\idea-workspace\java-client\cas-client-uportal\src" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
||||
</PATH_ELEMENT>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="PsiDirectory:C:\idea-workspace\java-client\cas-client-uportal\src\main" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
||||
</PATH_ELEMENT>
|
||||
</PATH>
|
||||
<PATH>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="cas-client.ipr" />
|
||||
|
|
@ -407,38 +444,6 @@
|
|||
<option name="myItemId" value="cas-client.ipr" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
||||
</PATH_ELEMENT>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="cas-client-core" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
|
||||
</PATH_ELEMENT>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="PsiDirectory:C:\idea-workspace\java-client\cas-client-core" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
||||
</PATH_ELEMENT>
|
||||
</PATH>
|
||||
<PATH>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="cas-client.ipr" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
||||
</PATH_ELEMENT>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="cas-client" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
|
||||
</PATH_ELEMENT>
|
||||
</PATH>
|
||||
<PATH>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="cas-client.ipr" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
||||
</PATH_ELEMENT>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="cas-client" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
|
||||
</PATH_ELEMENT>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="PsiDirectory:C:\idea-workspace\java-client" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
||||
</PATH_ELEMENT>
|
||||
</PATH>
|
||||
</subPane>
|
||||
</component>
|
||||
|
|
@ -447,12 +452,12 @@
|
|||
</component>
|
||||
<component name="ProjectView">
|
||||
<navigator currentView="ProjectPane" proportions="0.16666667" version="1" splitterProportion="0.5">
|
||||
<flattenPackages ProjectPane="false" />
|
||||
<showMembers />
|
||||
<flattenPackages ProjectPane="true" />
|
||||
<showMembers ProjectPane="true" />
|
||||
<showModules />
|
||||
<showLibraryContents />
|
||||
<hideEmptyPackages />
|
||||
<abbreviatePackageNames />
|
||||
<hideEmptyPackages ProjectPane="true" />
|
||||
<abbreviatePackageNames ProjectPane="false" />
|
||||
<showStructure Favorites="false" Scope="false" PackagesPane="false" ProjectPane="false" />
|
||||
<autoscrollToSource />
|
||||
<autoscrollFromSource />
|
||||
|
|
@ -480,16 +485,15 @@
|
|||
</component>
|
||||
<component name="RecentsManager" />
|
||||
<component name="RestoreUpdateTree" />
|
||||
<component name="RunManager" selected="JUnit.CasSecurityContextTests">
|
||||
<tempConfiguration default="false" name="CasSecurityContextTests" type="JUnit" factoryName="JUnit" enabled="false" merge="false">
|
||||
<pattern value="org.jasig.cas.client.integration.uportal.*" />
|
||||
<module name="cas-client-uportal" />
|
||||
<component name="RunManager" selected="JUnit.org.jasig.cas.client.integration.uportal">
|
||||
<tempConfiguration default="false" name="org.jasig.cas.client.integration.uportal" type="JUnit" factoryName="JUnit" enabled="false" merge="false">
|
||||
<module name="cas-client" />
|
||||
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
|
||||
<option name="ALTERNATIVE_JRE_PATH" />
|
||||
<option name="PACKAGE_NAME" value="org.jasig.cas.client.integration.uportal" />
|
||||
<option name="MAIN_CLASS_NAME" value="org.jasig.cas.client.integration.uportal.CasSecurityContextTests" />
|
||||
<option name="MAIN_CLASS_NAME" />
|
||||
<option name="METHOD_NAME" />
|
||||
<option name="TEST_OBJECT" value="class" />
|
||||
<option name="TEST_OBJECT" value="package" />
|
||||
<option name="VM_PARAMETERS" />
|
||||
<option name="PARAMETERS" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||
|
|
@ -503,6 +507,23 @@
|
|||
<option name="Make" value="true" />
|
||||
</method>
|
||||
</tempConfiguration>
|
||||
<configuration default="true" type="Application" factoryName="Application" enabled="false" merge="false">
|
||||
<option name="MAIN_CLASS_NAME" />
|
||||
<option name="VM_PARAMETERS" />
|
||||
<option name="PROGRAM_PARAMETERS" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
|
||||
<option name="ALTERNATIVE_JRE_PATH" />
|
||||
<option name="ENABLE_SWING_INSPECTOR" value="false" />
|
||||
<module name="" />
|
||||
</configuration>
|
||||
<configuration default="true" type="Remote" factoryName="Remote">
|
||||
<option name="USE_SOCKET_TRANSPORT" value="true" />
|
||||
<option name="SERVER_MODE" value="false" />
|
||||
<option name="SHMEM_ADDRESS" value="javadebug" />
|
||||
<option name="HOST" value="localhost" />
|
||||
<option name="PORT" value="5005" />
|
||||
</configuration>
|
||||
<configuration default="true" type="JUnit" factoryName="JUnit" enabled="false" merge="false">
|
||||
<module name="" />
|
||||
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
|
||||
|
|
@ -522,23 +543,6 @@
|
|||
<option name="Make" value="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration default="true" type="Remote" factoryName="Remote">
|
||||
<option name="USE_SOCKET_TRANSPORT" value="true" />
|
||||
<option name="SERVER_MODE" value="false" />
|
||||
<option name="SHMEM_ADDRESS" value="javadebug" />
|
||||
<option name="HOST" value="localhost" />
|
||||
<option name="PORT" value="5005" />
|
||||
</configuration>
|
||||
<configuration default="true" type="Application" factoryName="Application" enabled="false" merge="false">
|
||||
<option name="MAIN_CLASS_NAME" />
|
||||
<option name="VM_PARAMETERS" />
|
||||
<option name="PROGRAM_PARAMETERS" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
|
||||
<option name="ALTERNATIVE_JRE_PATH" />
|
||||
<option name="ENABLE_SWING_INSPECTOR" value="false" />
|
||||
<module name="" />
|
||||
</configuration>
|
||||
<configuration default="true" type="Applet" factoryName="Applet">
|
||||
<module name="" />
|
||||
<option name="MAIN_CLASS_NAME" />
|
||||
|
|
@ -636,6 +640,7 @@
|
|||
<option name="UPDATE_RUN_STATUS" value="false" />
|
||||
<option name="UPDATE_RECURSIVELY" value="true" />
|
||||
<option name="MERGE_DRY_RUN" value="false" />
|
||||
<configuration useDefault="true">C:\Documents and Settings\Scott\Application Data\Subversion</configuration>
|
||||
</component>
|
||||
<component name="TodoView" selected-index="0">
|
||||
<todo-panel id="selected-file">
|
||||
|
|
@ -656,28 +661,28 @@
|
|||
<editor active="false" />
|
||||
<layout>
|
||||
<window_info id="UI Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="3" />
|
||||
<window_info id="CVS" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3295129" order="8" />
|
||||
<window_info id="CVS" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.32857144" order="13" />
|
||||
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3295129" order="7" />
|
||||
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.32995194" order="0" />
|
||||
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.25200215" order="0" />
|
||||
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3295238" order="1" />
|
||||
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.24986653" order="1" />
|
||||
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3295129" order="8" />
|
||||
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33428845" order="6" />
|
||||
<window_info id="Module Dependencies" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32995194" order="3" x="651" y="237" width="618" height="695" />
|
||||
<window_info id="Dependency Viewer" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3295129" order="8" />
|
||||
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32857144" order="10" />
|
||||
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3295238" order="6" />
|
||||
<window_info id="Module Dependencies" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32995194" order="7" x="651" y="237" width="618" height="695" />
|
||||
<window_info id="Dependency Viewer" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32857144" order="11" />
|
||||
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="3" />
|
||||
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.24986653" order="1" />
|
||||
<window_info id="IDE talk" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32995194" order="3" />
|
||||
<window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3295129" order="8" />
|
||||
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3295129" order="2" />
|
||||
<window_info id="IDE talk" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.13988253" order="4" />
|
||||
<window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3295129" order="12" />
|
||||
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32857144" order="2" />
|
||||
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" order="2" />
|
||||
<window_info id="IDEtalk History" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.3295129" order="8" />
|
||||
<window_info id="File View" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="3" />
|
||||
<window_info id="IDEtalk History" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.24164279" order="8" />
|
||||
<window_info id="File View" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="6" />
|
||||
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" order="4" />
|
||||
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" order="0" />
|
||||
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="8" />
|
||||
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="9" />
|
||||
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="0" />
|
||||
<window_info id="Aspects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="3" />
|
||||
<window_info id="Aspects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="5" />
|
||||
<window_info id="Web" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" order="2" />
|
||||
<window_info id="EJB" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" order="3" />
|
||||
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" order="5" />
|
||||
|
|
@ -695,7 +700,7 @@
|
|||
<option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="true" />
|
||||
<option name="PUT_FOCUS_INTO_COMMENT" value="false" />
|
||||
<option name="FORCE_NON_EMPTY_COMMENT" value="false" />
|
||||
<option name="LAST_COMMIT_MESSAGE" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="" />
|
||||
<option name="SAVE_LAST_COMMIT_MESSAGE" value="true" />
|
||||
<option name="CHECKIN_DIALOG_SPLITTER_PROPORTION" value="0.8" />
|
||||
<option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="false" />
|
||||
|
|
@ -704,7 +709,7 @@
|
|||
<option name="FILE_HISTORY_DIALOG_COMMENTS_SPLITTER_PROPORTION" value="0.8" />
|
||||
<option name="FILE_HISTORY_DIALOG_SPLITTER_PROPORTION" value="0.5" />
|
||||
<option name="ERROR_OCCURED" value="false" />
|
||||
<option name="ACTIVE_VCS_NAME" value="cvs" />
|
||||
<option name="ACTIVE_VCS_NAME" value="CVS" />
|
||||
<option name="UPDATE_GROUP_BY_PACKAGES" value="false" />
|
||||
<option name="SHOW_FILE_HISTORY_AS_TREE" value="false" />
|
||||
<option name="FILE_HISTORY_SPLITTER_PROPORTION" value="0.6" />
|
||||
|
|
@ -761,113 +766,107 @@
|
|||
<option name="myLastEditedConfigurable" />
|
||||
</component>
|
||||
<component name="editorHistoryManager">
|
||||
<entry file="file://$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/web/filter/AbstractCasFilter.java">
|
||||
<entry file="file://$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/web/filter/CasAuthenticationFilter.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="67" column="22" selection-start="2202" selection-end="2202" vertical-scroll-proportion="0.3323263">
|
||||
<state line="26" column="0" selection-start="838" selection-end="838" vertical-scroll-proportion="0.32228917">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/validation/AssertionImpl.java">
|
||||
<entry file="file://$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/util/XmlUtils.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="48" column="78" selection-start="1595" selection-end="1595" vertical-scroll-proportion="0.5377644">
|
||||
<state line="57" column="86" selection-start="1785" selection-end="1785" vertical-scroll-proportion="0.32228917">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/cas-client-uportal/src/test/java/org/jasig/cas/client/integration/uportal/ThreadLocalAwareCasServiceFilterTests.java">
|
||||
<entry file="file://$PROJECT_DIR$/cas-client-uportal/src/main/java/org/jasig/cas/client/integration/uportal/CasConnectionContext.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="50" column="58" selection-start="1925" selection-end="1925" vertical-scroll-proportion="1.2839879">
|
||||
<folding>
|
||||
<element signature="imports" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/cas-client-uportal/src/test/java/org/jasig/cas/client/integration/uportal/ThreadLocalAwareCasSecurityContextTests.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="25" column="37" selection-start="849" selection-end="849" vertical-scroll-proportion="0.64199394">
|
||||
<folding>
|
||||
<element signature="imports" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/cas-client-uportal/src/main/java/org/jasig/cas/client/integration/uportal/ThreadLocalAwareCasSecurityContext.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="19" column="60" selection-start="799" selection-end="799" vertical-scroll-proportion="0.24924472">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/cas-client-uportal/src/main/java/org/jasig/cas/client/integration/uportal/ICasSecurityContext.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="21" column="46" selection-start="710" selection-end="710" vertical-scroll-proportion="0.46223566">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/cas-client-uportal/src/test/java/org/jasig/cas/client/integration/uportal/CasSecurityContextTests.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="21" column="54" selection-start="754" selection-end="754" vertical-scroll-proportion="0.53927493">
|
||||
<folding>
|
||||
<element signature="imports" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/cas-client-uportal/src/main/java/org/jasig/cas/client/integration/uportal/CasSecurityContextFactory.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="20" column="50" selection-start="742" selection-end="742" vertical-scroll-proportion="0.25073746">
|
||||
<state line="26" column="32" selection-start="887" selection-end="887" vertical-scroll-proportion="0.10559006">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/cas-client-uportal/src/main/java/org/jasig/cas/client/integration/uportal/CasSecurityContext.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="68" column="37" selection-start="2538" selection-end="2538" vertical-scroll-proportion="0.63678515">
|
||||
<state line="50" column="22" selection-start="1588" selection-end="1588" vertical-scroll-proportion="0.3431677">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/cas-client-uportal/src/main/java/org/jasig/cas/client/integration/uportal/ThreadLocalAwareCasServiceFilter.java">
|
||||
<entry file="jar://C:/Documents and Settings/Scott/.m2/repository/jasig/uportal/2.5.3-rc1/uportal-2.5.3-rc1.jar!/org/jasig/portal/security/InitialSecurityContextFactory.class">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="30" column="33" selection-start="1104" selection-end="1104" vertical-scroll-proportion="0.30664653">
|
||||
<state line="5" column="13" selection-start="163" selection-end="163" vertical-scroll-proportion="0.10810811">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/cas-client-uportal/src/main/java/org/jasig/cas/client/integration/uportal/ServiceHolder.java">
|
||||
<entry file="file://$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/web/filter/CasValidationFilter.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="13" column="19" selection-start="462" selection-end="462" vertical-scroll-proportion="0.3081571">
|
||||
<state line="75" column="112" selection-start="3403" selection-end="3403" vertical-scroll-proportion="0.21464393">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/cas-client-uportal/cas-client-uportal.iml">
|
||||
<entry file="file://$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/util/FilterToBeanProxy.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
|
||||
<state line="68" column="5" selection-start="2292" selection-end="2292" vertical-scroll-proportion="0.8635908">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/cas-client-uportal/pom.xml">
|
||||
<entry file="file://$PROJECT_DIR$/cas-client-uportal/src/main/java/org/jasig/cas/client/integration/uportal/AbstractCasSecurityContextFactory.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="77" column="15" selection-start="2876" selection-end="2876" vertical-scroll-proportion="0.8912387">
|
||||
<state line="25" column="12" selection-start="911" selection-end="911" vertical-scroll-proportion="0.25576732">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/cas-client-core/pom.xml">
|
||||
<entry file="file://$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/proxy/AbstractProxyReceptorServlet.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="25" column="51" selection-start="1024" selection-end="1024" vertical-scroll-proportion="-0.20543806">
|
||||
<state line="79" column="36" selection-start="2803" selection-end="2803" vertical-scroll-proportion="0.6760281">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/pom.xml">
|
||||
<entry file="file://$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/validation/AssertionImpl.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="14" column="46" selection-start="600" selection-end="600" vertical-scroll-proportion="-2.10574">
|
||||
<state line="65" column="17" selection-start="1832" selection-end="1832" vertical-scroll-proportion="0.8328417">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/validation/Cas20ProxyTicketValidator.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="85" column="24" selection-start="3761" selection-end="3761" vertical-scroll-proportion="0.37225547">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/validation/Cas20ServiceTicketValidator.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="75" column="33" selection-start="3045" selection-end="3045" vertical-scroll-proportion="0.50798404">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/cas-client-uportal/src/main/java/org/jasig/cas/client/integration/uportal/ThreadLocalAwareCasSecurityContextFactory.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="17" column="14" selection-start="537" selection-end="537" vertical-scroll-proportion="0.2173058">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/web/filter/AbstractCasFilter.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="105" column="16" selection-start="3434" selection-end="3434" vertical-scroll-proportion="0.21042281">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/cas-client-core/src/main/java/org/jasig/cas/client/proxy/ProxyGrantingTicketStorageImpl.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="125" column="66" selection-start="3869" selection-end="3869" vertical-scroll-proportion="0.6155359">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
|
|
|
|||
Loading…
Reference in New Issue