org.objectweb.jonas.security.realm.web.catalina55
Class Standard

java.lang.Object
  extended by org.apache.catalina.realm.RealmBase
      extended by org.objectweb.jonas.security.realm.web.catalina55.Standard
All Implemented Interfaces:
javax.management.MBeanRegistration, org.apache.catalina.Lifecycle, org.apache.catalina.Realm

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

Implementation of a Realm. (by a wrapper) Use any JOnAS realm by specifying the resource name

Author:
Florent Benoit

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.catalina.realm.RealmBase
org.apache.catalina.realm.RealmBase.AllRolesMode
 
Field Summary
 
Fields inherited from class org.apache.catalina.realm.RealmBase
allRolesMode, container, 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
Standard()
           
 
Method Summary
 java.security.Principal authenticate(java.lang.String username, java.lang.String credentials)
          Return the Principal associated with the specified username and credentials, if there is one; otherwise return null.
 java.security.Principal authenticate(java.security.cert.X509Certificate[] cert)
          Return the Principal associated with the specified chain of X509 client certificates.
 java.lang.String getInfo()
          Return descriptive information about this Realm implementation and the corresponding version number, in the format <description>/<version>.
protected  java.lang.String getName()
          Return a short name for this Realm implementation.
protected  java.lang.String getPassword(java.lang.String username)
          Return the password associated with the given principal's user name.
protected  java.security.Principal getPrincipal(java.lang.String username)
          Return the Principal associated with the given user name.
 java.lang.String getResourceName()
          Return the resource name we will be using.
protected  void log(java.lang.String message)
          Log a message on the Logger associated with our Container (if any)
 void setResourceName(java.lang.String resourceName)
          Set the resource name we will be using.
 void start()
          Prepare for active use of the public methods of this Component.
 void stop()
          Gracefully shut down active use of the public methods of this Component.
 
Methods inherited from class org.apache.catalina.realm.RealmBase
addLifecycleListener, addPropertyChangeListener, authenticate, authenticate, backgroundProcess, destroy, digest, Digest, findLifecycleListeners, findSecurityConstraints, getAllRolesMode, getContainer, getController, getDigest, getDigest, getDigestEncoding, getDomain, getObjectName, getPrincipal, getType, getValidate, hasMessageDigest, hasResourcePermission, hasRole, hasUserDataPermission, init, main, postDeregister, postRegister, preDeregister, preRegister, removeLifecycleListener, removePropertyChangeListener, setAllRolesMode, setContainer, setController, setDigest, setDigestEncoding, setValidate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Standard

public Standard()
Method Detail

getInfo

public java.lang.String getInfo()
Return descriptive information about this Realm implementation and the corresponding version number, in the format <description>/<version>.

Specified by:
getInfo in interface org.apache.catalina.Realm
Overrides:
getInfo in class org.apache.catalina.realm.RealmBase
Returns:
the info.

getResourceName

public java.lang.String getResourceName()
Return the resource name we will be using.

Returns:
the resource name.

setResourceName

public void setResourceName(java.lang.String resourceName)
Set the resource name we will be using.

Parameters:
resourceName - The new resource name

authenticate

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

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

authenticate

public java.security.Principal authenticate(java.security.cert.X509Certificate[] cert)
Return the Principal associated with the specified chain of X509 client certificates. If there is none, return null.

Specified by:
authenticate in interface org.apache.catalina.Realm
Overrides:
authenticate in class org.apache.catalina.realm.RealmBase
Parameters:
cert - Array of client certificates, with the first one in the array being the certificate of the client itself.
Returns:
the associated Principal

getName

protected java.lang.String getName()
Return a short name for this Realm implementation.

Specified by:
getName in class org.apache.catalina.realm.RealmBase
Returns:
the name

getPassword

protected java.lang.String getPassword(java.lang.String username)
Return the password associated with the given principal's user name.

Specified by:
getPassword in class org.apache.catalina.realm.RealmBase
Parameters:
username - the given principal's user name.
Returns:
the password associated.

getPrincipal

protected java.security.Principal getPrincipal(java.lang.String username)
Return the Principal associated with the given user name.

Specified by:
getPrincipal in class org.apache.catalina.realm.RealmBase
Parameters:
username - the given principal's user name.
Returns:
the Principal associated

start

public void start()
           throws org.apache.catalina.LifecycleException
Prepare for active use of the public methods of this Component.

Specified by:
start in interface org.apache.catalina.Lifecycle
Overrides:
start in class org.apache.catalina.realm.RealmBase
Throws:
org.apache.catalina.LifecycleException - if this component detects a fatal error that prevents it from being started

stop

public void stop()
          throws org.apache.catalina.LifecycleException
Gracefully shut down active use of the public methods of this Component.

Specified by:
stop in interface org.apache.catalina.Lifecycle
Overrides:
stop in class org.apache.catalina.realm.RealmBase
Throws:
org.apache.catalina.LifecycleException - if this component detects a fatal error that needs to be reported

log

protected void log(java.lang.String message)
Log a message on the Logger associated with our Container (if any)

Parameters:
message - Message to be logged