Framework Serveur J2EE ACube V3.1.0
CLASSE PRECEDANTE CLASSE SUIVANTE
SOMMAIRE: ATTR CONSTR METH DETAIL: ATTR CONSTR METH

acube.framework.clavierVirtuel.realm
Classe JAASRealm
java.lang.Object
  org.apache.catalina.realm.RealmBase
      acube.framework.clavierVirtuel.realm.RealmBaseAcube
          acube.framework.clavierVirtuel.realm.JAASRealm
Interfaces à implémenter:
org.apache.catalina.Lifecycle, MBeanRegistration, org.apache.catalina.Realm

public class JAASRealm
hérite de RealmBaseAcube

Implmentation of Realm that authenticates users via the Java Authentication and Authorization Service (JAAS). JAAS support requires either JDK 1.4 (which includes it as part of the standard platform) or JDK 1.3 (with the plug-in jaas.jar file).

The value configured for the appName property is passed to the javax.security.auth.login.LoginContext constructor, to specify the application NAME used to select the set of relevant LoginModules required.

The JAAS Specification describes the result of a successful login as a javax.security.auth.Subject instance, which can contain zero or more java.security.Principal objects in the return value of the Subject.getPrincipals() method. However, it provides no guidance on how to distinguish Principals that describe the individual user (and are thus appropriate to return as the value of request.getUserPrincipal() in a web application) from the Principal(s) that describe the authorized roles for this user. To maintain as much independence as possible from the underlying LoginMethod implementation executed by JAAS, the following policy is implemented by this Realm:

Author:
Craig R. McClanahan
Yoav Shapira
Version:
$Revision: 1.1 $ $Date: 2005-04-01 05:36:52 -0600 (Fri, 01 Apr 2005) $

Sommaire des Attributs
private String
appName
The application NAME passed to the JAAS LoginContext, which uses it to select the set of relevant LoginModules.
protected static final String
INFO
Descriptive information about this Realm implementation.
protected static final String
NAME
Descriptive information about this Realm implementation.
private List
roleClasses
The list of role class names, split out for easy processing.
private String
roleClassNames
Comma-delimited list of java.security.Principal classes that represent security roles.
protected static final org.apache.catalina.util.StringManager
SM
The string manager for this package.
private boolean
useContextClassLoader
Whether to use context ClassLoader or default ClassLoader.
private List
userClasses
The set of user class names, split out for easy processing.
private String
userClassNames
Comma-delimited list of java.security.Principal classes that represent individual users.
Attributs hérités de l'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
Sommaire des Constructeurs
Sommaire des Méthodes
Principal
authenticate(String username, String credentials)
{@inheritDoc}
protected Principal
createPrincipal(String username, Subject subject)
Identify and return a java.security.Principal instance representing the authenticated user for the specified Subject.
String
getAppName()
getter for the appName member variable
protected String
getName()
{@inheritDoc}
protected String
getPassword(String username)
{@inheritDoc}
protected Principal
getPrincipal(String username)
{@inheritDoc}
String
String
boolean
isUseContextClassLoader()
Returns whether to use the context or default ClassLoader.
protected String
makeLegalForJAAS(String src)
Ensure the given NAME is legal for JAAS configuration.
void
setAppName(String applicationName)
Deprecated. JAAS should use the Engine (domain) NAME and webpp/host overrides
void
setContainer(org.apache.catalina.Container container)
{@inheritDoc}
void
setRoleClassNames(String roleClassNamesParameter)
Sets the list of comma-delimited classes that represent roles.
void
setUseContextClassLoader(boolean useContext)
Sets whether to use the context or default ClassLoader.
void
setUserClassNames(String userClassNames)
Sets the list of comma-delimited classes that represent individual users.
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.
Méthodes héritées de la classe acube.framework.clavierVirtuel.realm.RealmBaseAcube
authenticate
Méthodes héritées de la classe org.apache.catalina.realm.RealmBase
addLifecycleListener, addPropertyChangeListener, authenticate, authenticate, authenticate, authenticate, backgroundProcess, destroy, Digest, findLifecycleListeners, findSecurityConstraints, getAllRolesMode, getContainer, getController, getDigest, getDigestEncoding, getDomain, getInfo, getObjectName, getType, getValidate, hasResourcePermission, hasRole, hasUserDataPermission, init, main, postDeregister, postRegister, preDeregister, preRegister, removeLifecycleListener, removePropertyChangeListener, setAllRolesMode, setContainer, setController, setDigest, setDigestEncoding, setValidate, start, stop
Méthodes héritées de la classe java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Méthodes héritées de l'interface org.apache.catalina.Lifecycle
addLifecycleListener, findLifecycleListeners, removeLifecycleListener, start, stop
Méthodes héritées de l'interface org.apache.catalina.Realm
addPropertyChangeListener, authenticate, authenticate, authenticate, authenticate, backgroundProcess, findSecurityConstraints, getContainer, getInfo, hasResourcePermission, hasRole, hasUserDataPermission, removePropertyChangeListener, setContainer
Méthodes héritées de l'interface javax.management.MBeanRegistration
postDeregister, postRegister, preDeregister, preRegister
Détail des Attributs
INFO
protected static final String INFO
Descriptive information about this Realm implementation.

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

SM
protected static final org.apache.catalina.util.StringManager SM
The string manager for this package.

appName
private String appName
The application NAME passed to the JAAS LoginContext, which uses it to select the set of relevant LoginModules.

userClassNames
private String userClassNames
Comma-delimited list of java.security.Principal classes that represent individual users.

roleClassNames
private String roleClassNames
Comma-delimited list of java.security.Principal classes that represent security roles.

userClasses
private List userClasses
The set of user class names, split out for easy processing.

useContextClassLoader
private boolean useContextClassLoader
Whether to use context ClassLoader or default ClassLoader. True means use context ClassLoader, and True is the default value.

roleClasses
private List roleClasses
The list of role class names, split out for easy processing.
Détail des Constructeurs
JAASRealm
public JAASRealm()
Détail des méthodes
setAppName
public void setAppName(String applicationName)
Dépréciée. JAAS should use the Engine (domain) NAME and webpp/host overrides
setter for the appName member variable
Paramètres:
applicationName - the appName member variable

getAppName
public String getAppName()
getter for the appName member variable
Retours:
the appName member variable

setUseContextClassLoader
public void setUseContextClassLoader(boolean useContext)
Sets whether to use the context or default ClassLoader. True means use context ClassLoader.
Paramètres:
useContext - True means use context ClassLoader

isUseContextClassLoader
public boolean isUseContextClassLoader()
Returns whether to use the context or default ClassLoader. True means to use the context ClassLoader.
Retours:
The value of useContextClassLoader

setContainer
public void setContainer(org.apache.catalina.Container container)
{@inheritDoc}
Spécifié par:
setContainer in interface org.apache.catalina.Realm
Dépacées:
setContainer in class org.apache.catalina.realm.RealmBase

getRoleClassNames
public String getRoleClassNames()
Retours:
the role class names

setRoleClassNames
public void setRoleClassNames(String roleClassNamesParameter)
Sets the list of comma-delimited classes that represent roles. The classes in the list must implement java.security.Principal. When this accessor is called (for example, by a Digester instance parsing the configuration file), it will parse the class names and store the resulting string(s) into the ArrayList field roleClasses.
Paramètres:
roleClassNamesParameter - the role class names

getUserClassNames
public String getUserClassNames()
Retours:
the user class names

setUserClassNames
public void setUserClassNames(String userClassNames)
Sets the list of comma-delimited classes that represent individual users. The classes in the list must implement java.security.Principal. When this accessor is called (for example, by a Digester instance parsing the configuration file), it will parse the class names and store the resulting string(s) into the ArrayList field userClasses.
Paramètres:
userClassNames - the user class names

authenticate
public Principal authenticate(String username,
                              String credentials)
{@inheritDoc}
Spécifié par:
authenticate in interface org.apache.catalina.Realm
Dépacées:

getName
protected String getName()
{@inheritDoc}
Dépacées:
getName in class org.apache.catalina.realm.RealmBase

getPassword
protected String getPassword(String username)
{@inheritDoc}
Dépacées:
getPassword in class org.apache.catalina.realm.RealmBase

getPrincipal
protected Principal getPrincipal(String username)
{@inheritDoc}
Dépacées:
getPrincipal in class org.apache.catalina.realm.RealmBase

createPrincipal
protected Principal createPrincipal(String username,
                                    Subject subject)
Identify and return a java.security.Principal instance representing the authenticated user for the specified Subject. The Principal is constructed by scanning the list of Principals returned by the JAASLoginModule. The first Principal object that matches one of the class names supplied as a "user class" is the user Principal. This object is returned to tha caller. Any remaining principal objects returned by the LoginModules are mapped to roles, but only if their respective classes match one of the "role class" classes. If a user Principal cannot be constructed, return null.
Paramètres:
username - the user NAME
subject - The Subject representing the logged-in user
Retours:
a java.security.Principal instance representing the authenticated user

makeLegalForJAAS
protected String makeLegalForJAAS(String src)
Ensure the given NAME is legal for JAAS configuration. Added for Bugzilla 30869, made protected for easy customization in case my implementation is insufficient, which I think is very likely.
Paramètres:
src - The NAME to validate
Retours:
A string that's a valid JAAS realm NAME

start
public void start()
           throws org.apache.catalina.LifecycleException
Prepare for active use of the public methods of this Component.
Spécifié par:
start in interface org.apache.catalina.Lifecycle
Dépacées:
start in class org.apache.catalina.realm.RealmBase
Exceptions:
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.
Spécifié par:
stop in interface org.apache.catalina.Lifecycle
Dépacées:
stop in class org.apache.catalina.realm.RealmBase
Exceptions:
org.apache.catalina.LifecycleException - if this component detects a fatal error that needs to be reported

Framework Serveur J2EE ACube V3.1.0
CLASSE PRECEDANTE CLASSE SUIVANTE
SOMMAIRE: ATTR CONSTR METH DETAIL: ATTR CONSTR METH

Version 3.1.0 du 06/11/2009 / Etat : Validé
Cette création est mise à disposition selon le Contrat Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique disponible en ligne http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ ou par courrier postal à Creative Commons, 559 Nathan Abbott Way, Stanford,California 94305, USA.
Documentation generated by DocFlex