org.jboss.resource.security
Class SecureIdentityLoginModule

java.lang.Object
  extended byorg.jboss.security.auth.spi.AbstractServerLoginModule
      extended byorg.jboss.resource.security.AbstractPasswordCredentialLoginModule
          extended byorg.jboss.resource.security.SecureIdentityLoginModule
All Implemented Interfaces:
LoginModule

public class SecureIdentityLoginModule
extends AbstractPasswordCredentialLoginModule

An example of how one could encrypt the database password for a jca connection factory. The corresponding sa -207a6df87216de44 jboss.jca:servce=LocalTxCM,name=DefaultDS This uses a hard-coded cipher algo of Blowfish, and key derived from the phrase 'jaas is the way'. Adjust to your requirements.

Version:
$Revision: 1.1.2.2 $
Author:
[email protected]

Field Summary
 
Fields inherited from class org.jboss.security.auth.spi.AbstractServerLoginModule
callbackHandler, loginOk, options, principalClassName, sharedState, subject, unauthenticatedIdentity, useFirstPass
 
Constructor Summary
SecureIdentityLoginModule()
           
 
Method Summary
 boolean abort()
           
 boolean commit()
           
protected  Principal getIdentity()
           
protected  Group[] getRoleSets()
           
 void initialize(Subject subject, CallbackHandler handler, Map sharedState, Map options)
           
 boolean login()
          Return false if there is no mcf, else return super.login().
static void main(String[] args)
          Main entry point to encrypt a password using the hard-coded pass phrase
 
Methods inherited from class org.jboss.resource.security.AbstractPasswordCredentialLoginModule
getMcf, getServer, logout, removeCredentials
 
Methods inherited from class org.jboss.security.auth.spi.AbstractServerLoginModule
createGroup, createIdentity, getUnauthenticatedIdentity, getUseFirstPass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SecureIdentityLoginModule

public SecureIdentityLoginModule()
Method Detail

initialize

public void initialize(Subject subject,
                       CallbackHandler handler,
                       Map sharedState,
                       Map options)
Specified by:
initialize in interface LoginModule
Overrides:
initialize in class AbstractPasswordCredentialLoginModule

login

public boolean login()
              throws LoginException
Description copied from class: AbstractPasswordCredentialLoginModule
Return false if there is no mcf, else return super.login(). Override to provide custom authentication.

Specified by:
login in interface LoginModule
Overrides:
login in class AbstractPasswordCredentialLoginModule
Returns:
false if there is no mcf, else return super.login().
Throws:
LoginException - if an error occurs

commit

public boolean commit()
               throws LoginException
Throws:
LoginException

abort

public boolean abort()

getIdentity

protected Principal getIdentity()

getRoleSets

protected Group[] getRoleSets()
                       throws LoginException
Throws:
LoginException

main

public static void main(String[] args)
                 throws Exception
Main entry point to encrypt a password using the hard-coded pass phrase

Parameters:
args - - [0] = the password to encode
Throws:
Exception


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