Save This Page
Home » jboss-5.0.0.CR1-src » org » jboss » security » auth » spi » [javadoc | source]
org.jboss.security.auth.spi
public class: UsersRolesLoginModule [javadoc | source]
java.lang.Object
   org.jboss.security.auth.spi.AbstractServerLoginModule
      org.jboss.security.auth.spi.UsernamePasswordLoginModule
         org.jboss.security.auth.spi.UsersRolesLoginModule

All Implemented Interfaces:
    LoginModule

A simple properties file based login module that consults two Java Properties formatted text files for username to password("users.properties") and username to roles("roles.properties") mapping. The names of the properties files may be overriden by the usersProperties and rolesProperties options. The properties files are loaded during initialization using the thread context class loader. This means that these files can be placed into the J2EE deployment jar or the JBoss config directory. The users.properties file uses a format: username1=password1 username2=password2 ... to define all valid usernames and their corresponding passwords. The roles.properties file uses a format: username1=role1,role2,... username1.RoleGroup1=role3,role4,... username2=role1,role3,... to define the sets of roles for valid usernames. The "username.XXX" form of property name is used to assign the username roles to a particular named group of roles where the XXX portion of the property name is the group name. The "username=..." form is an abbreviation for "username.Roles=...". The following are therefore equivalent: jduke=TheDuke,AnimatedCharacter jduke.Roles=TheDuke,AnimatedCharacter
Fields inherited from org.jboss.security.auth.spi.AbstractServerLoginModule:
subject,  callbackHandler,  sharedState,  options,  log,  useFirstPass,  loginOk
Method from org.jboss.security.auth.spi.UsersRolesLoginModule Summary:
getRoleSets,   getUsersPassword,   initialize,   login
Methods from org.jboss.security.auth.spi.UsernamePasswordLoginModule:
createPasswordHash,   getCredentials,   getIdentity,   getUnauthenticatedIdentity,   getUsername,   getUsernameAndPassword,   getUsersPassword,   initialize,   login,   validatePassword
Methods from org.jboss.security.auth.spi.AbstractServerLoginModule:
abort,   commit,   createGroup,   getIdentity,   getRoleSets,   getUseFirstPass,   initialize,   login,   logout
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.jboss.security.auth.spi.UsersRolesLoginModule Detail:
 protected Group[] getRoleSets() throws LoginException 
    Create the set of roles the user belongs to by parsing the roles.properties data for username=role1,role2,... and username.XXX=role1,role2,... patterns.
 protected String getUsersPassword() 
 public  void initialize(Subject subject,
    CallbackHandler callbackHandler,
    Map sharedState,
    Map options) 
    Initialize this LoginModule.
 public boolean login() throws LoginException 
    Method to authenticate a Subject (phase 1). This validates that the users and roles properties files were loaded and then calls super.login to perform the validation of the password.