added more debugging
This commit is contained in:
Scott Battaglia 2006-10-11 18:41:10 +00:00
parent ab07bfb897
commit 44b8c86586
7 changed files with 37 additions and 11 deletions

View File

@ -2,7 +2,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.jasig.cas</groupId>
<version>3.0-rc1</version>
<version>3.0-rc2</version>
<artifactId>cas-client</artifactId>
</parent>
<modelVersion>4.0.0</modelVersion>
@ -10,7 +10,7 @@
<artifactId>cas-client-core</artifactId>
<packaging>jar</packaging>
<name>JA-SIG CAS Client for Java - Core</name>
<version>3.0-rc1</version>
<version>3.0-rc2</version>
<build>
<sourceDirectory>src/main/java</sourceDirectory>
@ -79,6 +79,13 @@
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>2.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-mock</artifactId>
@ -90,11 +97,6 @@
<artifactId>spring-beans</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>

View File

@ -86,6 +86,8 @@ public abstract class AbstractCasFilter implements Filter {
this.serverName = serverName;
this.serviceUrl = serviceUrl;
this.useSession = useSession;
log.info("Service Name set to: " + this.serverName + "; Service Url set to: " + this.serviceUrl + "Use Session set to: " + this.useSession);
}
public final void destroy() {

View File

@ -69,7 +69,9 @@ public final class AuthenticationFilter extends AbstractCasFilter {
&& session.getAttribute(CONST_GATEWAY) != null;
if (CommonUtils.isBlank(ticket) && assertion == null && !wasGatewayed) {
log.debug("no ticket and no assertion found");
if (this.gateway && session != null) {
log.debug("setting gateway attribute in session");
session.setAttribute(CONST_GATEWAY, "yes");
}
@ -78,11 +80,17 @@ public final class AuthenticationFilter extends AbstractCasFilter {
+ URLEncoder.encode(serviceUrl, "UTF-8")
+ (this.renew ? "&renew=true" : "")
+ (this.gateway ? "&gateway=true" : "");
if (log.isDebugEnabled()) {
log.debug("redirecting to \"" + urlToRedirectTo + "\"");
}
response.sendRedirect(urlToRedirectTo);
return;
}
if (session != null) {
log.debug("removing gateway attribute from session");
session.setAttribute(CONST_GATEWAY, null);
}

View File

@ -11,6 +11,8 @@ import org.jasig.cas.client.authorization.AuthorizedDecider;
import org.jasig.cas.client.util.CommonUtils;
import org.jasig.cas.client.validation.Assertion;
import org.springframework.web.util.WebUtils;
import org.apache.commons.logging.LogFactory;
import org.apache.commons.logging.Log;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
@ -40,6 +42,12 @@ import java.io.IOException;
*/
public final class AuthorizationFilter implements Filter {
/**
* Instance of Commons Logging.
*/
private final Log log = LogFactory.getLog(this.getClass());
/**
* Decider that determines whether a specified principal has access to the
* resource or not.
@ -71,11 +79,13 @@ public final class AuthorizationFilter implements Filter {
.isAuthorizedToUseApplication(principal);
if (!authorized) {
log.debug("User not authorized to access application.");
response.setStatus(HttpServletResponse.SC_FORBIDDEN);
throw new AuthorizationException(principal.getId()
+ " is not authorized to use this application.");
}
log.debug("User successfully authorized.");
filterChain.doFilter(servletRequest, servletResponse);
}

View File

@ -71,6 +71,10 @@ public final class TicketValidationFilter extends AbstractCasFilter {
"ticketValidator cannot be null.");
this.ticketValidator = ticketValidator;
this.redirectAfterValidation = redirectAfterValidation;
log.info("Initialized with the following properties: " +
"ticketValidator=" + this.ticketValidator.getClass().getName() + "; " +
"redirectAfterValidation=" + this.redirectAfterValidation);
}
protected void doFilterInternal(final HttpServletRequest request,

View File

@ -3,13 +3,13 @@
<parent>
<groupId>org.jasig.cas</groupId>
<artifactId>cas-client</artifactId>
<version>3.0-rc1</version>
<version>3.0-rc2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jasig.cas</groupId>
<artifactId>cas-client-uportal</artifactId>
<packaging>jar</packaging>
<version>3.0-rc1</version>
<version>3.0-rc2</version>
<name>JA-SIG CAS Client for Java - uPortal Integration</name>
<url>http://www.ja-sig.org/products/cas/</url>
@ -67,7 +67,7 @@
<dependency>
<groupId>org.jasig.cas</groupId>
<artifactId>cas-client-core</artifactId>
<version>3.0-rc1</version>
<version>3.0-rc2</version>
</dependency>
</dependencies>
<reporting>

View File

@ -1,7 +1,7 @@
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jasig.cas</groupId>
<version>3.0-rc1</version>
<version>3.0-rc2</version>
<artifactId>cas-client</artifactId>
<packaging>pom</packaging>
<name>JA-SIG CAS Client for Java</name>