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

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

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

Implementation of a JAAS Realm. (by a wrapper) It uses the entry JAAS_CONFIG_NAME from the JAAS config file

Author:
Florent Benoit, Alexandre Thaveau (JAAS support with JOnAS), Marc-Antoine Bourgeot (JAAS support with JOnAS)

Nested Class Summary
 
Nested classes 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
JAAS()
           
 
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 X.509 certificate Distinguished Name if there is one; otherwise return null.
 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.
protected  void log(java.lang.String message)
          Log a message on the Logger associated with our Container (if any)
 void setUseUpperCaseUser(java.lang.String useUpperCaseUser)
          Redirect to setUseUpperCaseUserName() method.
 void setUseUpperCaseUserName(java.lang.String useUpperCaseUser)
          Authentication will be made with a username in uppercase
 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

JAAS

public JAAS()
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>.

Returns:
the info.

authenticate

public java.security.Principal authenticate(java.security.cert.X509Certificate[] cert)
Return the Principal associated with the specified X.509 certificate Distinguished Name if there is one; otherwise return null.

Parameters:
cert - X.509 Certificate of the user
Returns:
the principal associated

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.

Parameters:
username - Username of the Principal to look up
credentials - Password or other credentials to use in authenticating this username
Returns:
the principal associated

getName

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

Returns:
the name

getPassword

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

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.

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.

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.

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

setUseUpperCaseUser

public void setUseUpperCaseUser(java.lang.String useUpperCaseUser)
Redirect to setUseUpperCaseUserName() method.

Parameters:
useUpperCaseUser - boolean value : "true" or "false"

setUseUpperCaseUserName

public void setUseUpperCaseUserName(java.lang.String useUpperCaseUser)
Authentication will be made with a username in uppercase

Parameters:
useUpperCaseUser - boolean value : "true" or "false"