Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.acegisecurity.adapters.catalina
Class CatalinaAcegiUserRealm

    java.lang.Object
      org.apache.catalina.realm.RealmBase
          org.acegisecurity.adapters.catalina.CatalinaAcegiUserRealm

All Implemented Interfaces:
  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,v 1.9 2005/11/25 00:26:30 benalex Exp $
Author:
  Ben Alex

Field Summary
`protected String` | `name`

Fields inherited from class org.apache.catalina.realm.RealmBase
`debug, digest, info, lifecycle, md, md5Encoder, md5Helper, sm, started, support, validate`

Fields inherited from interface org.apache.catalina.Lifecycle
`AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_START_EVENT, BEFORE_STOP_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, digest, Digest, findLifecycleListeners, getContainer, getDebug, getDigest, getDigest, getInfo, getValidate, hasMessageDigest, log, log, main, removeLifecycleListener, removePropertyChangeListener, setContainer, setDebug, setDigest, 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

### setAppContextLocation

    public void setAppContextLocation(String appContextLocation)

### getAppContextLocation

    public String getAppContextLocation()

### setKey

    public void setKey(String key)

### getKey

    public String getKey()

### 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!

### 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`

### 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

### 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!

### 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

Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004-2005 Acegi Technology Pty Limited. All Rights Reserved.