org.apache.geronimo.tomcat.realm
Class TomcatJAASRealm

java.lang.Object
  extended by org.apache.catalina.realm.RealmBase
      extended by org.apache.catalina.realm.JAASRealm
          extended by org.apache.geronimo.tomcat.realm.TomcatJAASRealm
All Implemented Interfaces:
Cloneable, MBeanRegistration, org.apache.catalina.Lifecycle, org.apache.catalina.Realm

public class TomcatJAASRealm
extends org.apache.catalina.realm.JAASRealm
implements Cloneable


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.catalina.realm.RealmBase
org.apache.catalina.realm.RealmBase.AllRolesMode
 
Field Summary
protected static String info
          Descriptive information about this Realm implementation.
protected static String name
          Descriptive information about this Realm implementation.
 
Fields inherited from class org.apache.catalina.realm.JAASRealm
appName, roleClasses, roleClassNames, sm, useContextClassLoader, userClasses, userClassNames
 
Fields inherited from class org.apache.catalina.realm.RealmBase
allRolesMode, container, containerLog, controller, digest, digestEncoding, domain, host, initialized, lifecycle, md, md5Encoder, md5Helper, mserver, oname, path, 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
TomcatJAASRealm()
           
 
Method Summary
 Principal authenticate(String username, String credentials)
          Return the Principal associated with the specified username and credentials, if there is one; otherwise return null.
 Object clone()
           
protected  Principal createPrincipal(String username, Subject subject)
           
 boolean hasRole(Principal principal, String role)
           
 
Methods inherited from class org.apache.catalina.realm.JAASRealm
getAppName, getName, getPassword, getPrincipal, getRoleClassNames, getUserClassNames, isUseContextClassLoader, makeLegalForJAAS, parseClassNames, setAppName, setContainer, setRoleClassNames, setUseContextClassLoader, setUserClassNames, start, stop
 
Methods inherited from class org.apache.catalina.realm.RealmBase
addLifecycleListener, addPropertyChangeListener, authenticate, authenticate, authenticate, 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, setController, setDigest, setDigestEncoding, setValidate
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

info

protected static final String info
Descriptive information about this Realm implementation.

See Also:
Constant Field Values

name

protected static final String name
Descriptive information about this Realm implementation.

See Also:
Constant Field Values
Constructor Detail

TomcatJAASRealm

public TomcatJAASRealm()
Method Detail

authenticate

public Principal authenticate(String username,
                              String credentials)
Return the Principal associated with the specified username and credentials, if there is one; otherwise return null.

If there are any errors with the JDBC connection, executing the query or anything we return null (don't authenticate). This event is also logged, and the connection will be closed so that a subsequent request will automatically re-open it.

Specified by:
authenticate in interface org.apache.catalina.Realm
Overrides:
authenticate in class org.apache.catalina.realm.JAASRealm
Parameters:
username - Username of the Principal to look up
credentials - Password or other credentials to use in authenticating this username

createPrincipal

protected Principal createPrincipal(String username,
                                    Subject subject)
Overrides:
createPrincipal in class org.apache.catalina.realm.JAASRealm

clone

public Object clone()
             throws CloneNotSupportedException
Overrides:
clone in class Object
Throws:
CloneNotSupportedException

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


Copyright © 2003-2008 The Apache Geronimo development community. All Rights Reserved.