applied patch for Tomcat 7.0.8 support.
This commit is contained in:
Scott Battaglia 2011-02-27 04:54:41 +00:00
parent 84ad620b34
commit 35a6b08dac
3 changed files with 20 additions and 4 deletions

View File

@ -23,7 +23,7 @@
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-catalina</artifactId>
<version>7.0.0</version>
<version>7.0.8</version>
<type>jar</type>
<scope>compile</scope>
</dependency>

View File

@ -61,6 +61,15 @@ public abstract class AbstractAuthenticator extends AuthenticatorBase implements
protected abstract String getAuthenticationMethod();
/**
* Provided for Tomcat 7.0.8 support.
*
* @return the authentication method.
*/
protected String getAuthMethod() {
return getAuthenticationMethod();
}
/**
* Abstract method that subclasses should use to provide the name of the artifact parameter (i.e. ticket)
*

View File

@ -21,6 +21,7 @@ package org.jasig.cas.client.tomcat.v7;
import java.security.Principal;
import org.apache.catalina.Wrapper;
import org.apache.catalina.realm.RealmBase;
import org.jasig.cas.client.tomcat.CasRealm;
@ -43,11 +44,17 @@ public abstract class AbstractCasRealm extends RealmBase implements CasRealm {
return getDelegate().getRoles(p);
}
/** {@inheritDoc} */
public boolean hasRole(final Principal principal, final String role) {
return getDelegate().hasRole(principal, role);
}
/**
* Tomcat 7.0.8 changed their APIs so {@link #hasRole(java.security.Principal, String)} is only valid for 7.0.7 and below.
*/
public boolean hasRole(final Wrapper wrapper, final Principal principal, final String role) {
return hasRole(principal, role);
}
/** {@inheritDoc} */
public String toString() {
return getName();
@ -64,12 +71,12 @@ public abstract class AbstractCasRealm extends RealmBase implements CasRealm {
}
/** {@inheritDoc} */
protected String getPassword(final String username) {
protected String getPassword(final String userName) {
throw new UnsupportedOperationException();
}
/** {@inheritDoc} */
protected Principal getPrincipal(final String username) {
protected Principal getPrincipal(final String userName) {
throw new UnsupportedOperationException();
}