org.jboss.test.security.ejb
Class CustomPrincipalLoginModule

java.lang.Object
  extended byorg.jboss.security.auth.spi.AbstractServerLoginModule (src) 
      extended byorg.jboss.security.auth.spi.UsernamePasswordLoginModule (src) 
          extended byorg.jboss.test.security.ejb.CustomPrincipalLoginModule
All Implemented Interfaces:
javax.security.auth.spi.LoginModule

public class CustomPrincipalLoginModule
extends UsernamePasswordLoginModule (src)

Test of installing a custom principal via a login module.


Field Summary
 
Fields inherited from class org.jboss.security.auth.spi.AbstractServerLoginModule (src)
callbackHandler, log, loginOk, options, principalClassName, sharedState, subject, unauthenticatedIdentity, useFirstPass
 
Constructor Summary
CustomPrincipalLoginModule()
           
 
Method Summary
protected  java.security.Principal getIdentity()
          Overriden by subclasses to return the Principal that corresponds to the user primary identity.
protected  java.security.acl.Group[] getRoleSets()
          Overriden by subclasses to return the Groups that correspond to the to the role sets assigned to the user.
protected  java.lang.String getUsersPassword()
          Get the expected password for the current username available via the getUsername() method.
 boolean login()
          Perform the authentication of the username and password.
 
Methods inherited from class org.jboss.security.auth.spi.UsernamePasswordLoginModule (src)
createPasswordHash, getCredentials, getUnauthenticatedIdentity, getUsername, getUsernameAndPassword, initialize, validatePassword
 
Methods inherited from class org.jboss.security.auth.spi.AbstractServerLoginModule (src)
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

CustomPrincipalLoginModule

public CustomPrincipalLoginModule()
Method Detail

login

public boolean login()
              throws javax.security.auth.login.LoginException
Description copied from class: UsernamePasswordLoginModule (src)
Perform the authentication of the username and password.

Specified by:
login in interface javax.security.auth.spi.LoginModule
Overrides:
login in class UsernamePasswordLoginModule (src)
Throws:
javax.security.auth.login.LoginException

getIdentity

protected java.security.Principal getIdentity()
Description copied from class: AbstractServerLoginModule (src)
Overriden by subclasses to return the Principal that corresponds to the user primary identity.

Overrides:
getIdentity in class UsernamePasswordLoginModule (src)

getRoleSets

protected java.security.acl.Group[] getRoleSets()
                                         throws javax.security.auth.login.LoginException
Description copied from class: AbstractServerLoginModule (src)
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.

Specified by:
getRoleSets in class AbstractServerLoginModule (src)
Returns:
Group[] containing the sets of roles
Throws:
javax.security.auth.login.LoginException

getUsersPassword

protected java.lang.String getUsersPassword()
Description copied from class: UsernamePasswordLoginModule (src)
Get the expected password for the current username available via the getUsername() method. This is called from within the login() method after the CallbackHandler has returned the username and candidate password.

Specified by:
getUsersPassword in class UsernamePasswordLoginModule (src)
Returns:
the valid password String