org.jboss.mq.sm.file
Class DynamicLoginModule

java.lang.Object
  extended by org.jboss.security.auth.spi.AbstractServerLoginModule
      extended by org.jboss.security.auth.spi.UsernamePasswordLoginModule
          extended by org.jboss.mq.sm.file.DynamicLoginModule
All Implemented Interfaces:
LoginModule

public class DynamicLoginModule
extends org.jboss.security.auth.spi.UsernamePasswordLoginModule

JAAS LoginModule that is backed by the DynamicStateManager. Must have the attribute sm.objectname set, and may have the unauthenticatedIdentity set to some value.

Version:
$Revision: 1.4.6.2 $
Author:
Peter Antman

Field Summary
 
Fields inherited from class org.jboss.security.auth.spi.AbstractServerLoginModule
callbackHandler, log, loginOk, options, principalClassName, sharedState, subject, unauthenticatedIdentity, useFirstPass
 
Constructor Summary
DynamicLoginModule()
           
 
Method Summary
protected  Group[] getRoleSets()
          Overriden by subclasses to return the Groups that correspond to the to the role sets assigned to the user.
protected  String getUsersPassword()
          Overriden to return an empty password string as typically one cannot obtain a user's password.
 void initialize(Subject subject, CallbackHandler callbackHandler, Map sharedState, Map options)
           
 boolean login()
          Check we have contact to a state manager.
protected  boolean validatePassword(String inputPassword, String expectedPassword)
          Validate the password againts the state manager.
 
Methods inherited from class org.jboss.security.auth.spi.UsernamePasswordLoginModule
createPasswordHash, getCredentials, getIdentity, getUnauthenticatedIdentity, getUsername, getUsernameAndPassword, getValidateError, setValidateError
 
Methods inherited from class org.jboss.security.auth.spi.AbstractServerLoginModule
abort, commit, createGroup, createIdentity, getUseFirstPass, logout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DynamicLoginModule

public DynamicLoginModule()
Method Detail

initialize

public void initialize(Subject subject,
                       CallbackHandler callbackHandler,
                       Map sharedState,
                       Map options)
Specified by:
initialize in interface LoginModule
Overrides:
initialize in class org.jboss.security.auth.spi.UsernamePasswordLoginModule

login

public boolean login()
              throws LoginException
Check we have contact to a state manager.

Specified by:
login in interface LoginModule
Overrides:
login in class org.jboss.security.auth.spi.UsernamePasswordLoginModule
Throws:
LoginException

getUsersPassword

protected String getUsersPassword()
                           throws LoginException
Overriden to return an empty password string as typically one cannot obtain a user's password. We also override the validatePassword so this is ok.

Specified by:
getUsersPassword in class org.jboss.security.auth.spi.UsernamePasswordLoginModule
Returns:
and empty password String
Throws:
LoginException

validatePassword

protected boolean validatePassword(String inputPassword,
                                   String expectedPassword)
Validate the password againts the state manager.

Overrides:
validatePassword in class org.jboss.security.auth.spi.UsernamePasswordLoginModule
Parameters:
inputPassword - the password to validate.
expectedPassword - ignored

getRoleSets

protected Group[] getRoleSets()
                       throws LoginException
Overriden by subclasses to return the Groups that correspond to the to the role sets assigned to the user. Subclasses should create at least a Group named "Roles" that contains the roles assigned to the user. A second common group is "CallerPrincipal" that provides the application identity of the user rather than the security domain identity. Only a Roles Group is returned.

Specified by:
getRoleSets in class org.jboss.security.auth.spi.AbstractServerLoginModule
Returns:
Group[] containing the sets of roles
Throws:
LoginException


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.