org.acegisecurity.adapters.catalina
Class CatalinaAcegiUserRealm

java.lang.Object
  extended by org.apache.catalina.realm.RealmBase
      extended by org.acegisecurity.adapters.catalina.CatalinaAcegiUserRealm
All Implemented Interfaces:
MBeanRegistration, org.apache.catalina.Lifecycle, org.apache.catalina.Realm

public class CatalinaAcegiUserRealm
extends org.apache.catalina.realm.RealmBase

Adapter to enable Catalina (Tomcat) to authenticate via the Acegi Security System for Spring.

Returns a PrincipalAcegiUserToken to Catalina's authentication system, which is subsequently available via HttpServletRequest.getUserPrincipal().

Version:
$Id: CatalinaAcegiUserRealm.java 1496 2006-05-23 13:38:33Z benalex $
Author:
Ben Alex

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.catalina.realm.RealmBase
org.apache.catalina.realm.RealmBase.AllRolesMode
 
Field Summary
protected  String name
           
 
Fields inherited from class org.apache.catalina.realm.RealmBase
allRolesMode, containerLog, controller, digest, digestEncoding, domain, host, info, initialized, lifecycle, md, md5Encoder, md5Helper, mserver, oname, path, sm, started, support, type, validate
 
Fields inherited from interface org.apache.catalina.Lifecycle
AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, DESTROY_EVENT, INIT_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT
 
Constructor Summary
CatalinaAcegiUserRealm()
           
 
Method Summary
 Principal authenticate(String username, byte[] credentials)
           
 Principal authenticate(String username, String credentials)
           
 Principal authenticate(String username, String digest, String nonce, String nc, String cnonce, String qop, String realm, String md5a2)
          Not supported, returns null
 Principal authenticate(X509Certificate[] x509Certificates)
          Not supported, returns null
 String getAppContextLocation()
           
 String getKey()
           
protected  String getName()
           
protected  String getPassword(String arg0)
          Always returns null (we override authenticate methods)
protected  Principal getPrincipal(String arg0)
          Always returns null (we override authenticate methods)
 boolean hasRole(Principal principal, String role)
           
 void setAppContextLocation(String appContextLocation)
           
 void setKey(String key)
           
 void start()
          Provides the method that Catalina will use to start the container.
protected  void startForTest()
          Provides a method to load the container adapter without delegating to the superclass, which cannot operate outside the Catalina container.
 
Methods inherited from class org.apache.catalina.realm.RealmBase
addLifecycleListener, addPropertyChangeListener, backgroundProcess, destroy, digest, Digest, findLifecycleListeners, findSecurityConstraints, getAllRolesMode, getContainer, getController, getDigest, getDigest, getDigestEncoding, getDomain, getInfo, getObjectName, getPrincipal, getType, getValidate, hasMessageDigest, hasResourcePermission, hasUserDataPermission, init, main, postDeregister, postRegister, preDeregister, preRegister, removeLifecycleListener, removePropertyChangeListener, setAllRolesMode, setContainer, setController, setDigest, setDigestEncoding, setValidate, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected final String name
See Also:
Constant Field Values
Constructor Detail

CatalinaAcegiUserRealm

public CatalinaAcegiUserRealm()
Method Detail

authenticate

public Principal authenticate(String username,
                              String credentials)
Specified by:
authenticate in interface org.apache.catalina.Realm
Overrides:
authenticate in class org.apache.catalina.realm.RealmBase

authenticate

public Principal authenticate(String username,
                              byte[] credentials)
Specified by:
authenticate in interface org.apache.catalina.Realm
Overrides:
authenticate in class org.apache.catalina.realm.RealmBase

authenticate

public Principal authenticate(String username,
                              String digest,
                              String nonce,
                              String nc,
                              String cnonce,
                              String qop,
                              String realm,
                              String md5a2)
Not supported, returns null

Specified by:
authenticate in interface org.apache.catalina.Realm
Overrides:
authenticate in class org.apache.catalina.realm.RealmBase
Parameters:
username - DOCUMENT ME!
digest - DOCUMENT ME!
nonce - DOCUMENT ME!
nc - DOCUMENT ME!
cnonce - DOCUMENT ME!
qop - DOCUMENT ME!
realm - DOCUMENT ME!
md5a2 - DOCUMENT ME!
Returns:
DOCUMENT ME!

authenticate

public Principal authenticate(X509Certificate[] x509Certificates)
Not supported, returns null

Specified by:
authenticate in interface org.apache.catalina.Realm
Overrides:
authenticate in class org.apache.catalina.realm.RealmBase
Parameters:
x509Certificates - DOCUMENT ME!
Returns:
DOCUMENT ME!

getAppContextLocation

public String getAppContextLocation()

getKey

public String getKey()

getName

protected String getName()
Specified by:
getName in class org.apache.catalina.realm.RealmBase

getPassword

protected String getPassword(String arg0)
Always returns null (we override authenticate methods)

Specified by:
getPassword in class org.apache.catalina.realm.RealmBase
Parameters:
arg0 - DOCUMENT ME!
Returns:
DOCUMENT ME!

getPrincipal

protected Principal getPrincipal(String arg0)
Always returns null (we override authenticate methods)

Specified by:
getPrincipal in class org.apache.catalina.realm.RealmBase
Parameters:
arg0 - DOCUMENT ME!
Returns:
DOCUMENT ME!

hasRole

public boolean hasRole(Principal principal,
                       String role)
Specified by:
hasRole in interface org.apache.catalina.Realm
Overrides:
hasRole in class org.apache.catalina.realm.RealmBase

setAppContextLocation

public void setAppContextLocation(String appContextLocation)

setKey

public void setKey(String key)

start

public void start()
           throws org.apache.catalina.LifecycleException
Provides the method that Catalina will use to start the container.

Specified by:
start in interface org.apache.catalina.Lifecycle
Overrides:
start in class org.apache.catalina.realm.RealmBase
Throws:
org.apache.catalina.LifecycleException - if a problem is detected

startForTest

protected void startForTest()
                     throws org.apache.catalina.LifecycleException
Provides a method to load the container adapter without delegating to the superclass, which cannot operate outside the Catalina container.

Throws:
org.apache.catalina.LifecycleException - if a problem is detected


Copyright © 2004-2009 Interface21, Inc. All Rights Reserved.