当前页面:
在线文档首页 >
JBoss 4.0.1 sp1 connector API Documentation 英文版文档
SecureIdentityLoginModule (JBoss Connector API) - JBoss 4.0.1 sp1 connector API Documentation 英文版文档
org.jboss.resource.security
Class SecureIdentityLoginModule
java.lang.Object
org.jboss.security.auth.spi.AbstractServerLoginModule
org.jboss.resource.security.AbstractPasswordCredentialLoginModule
org.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.3 $
- Author:
- Scott.Stark@jboss.org, Noel Rocher 29, june 2004 username & userName issue
Fields inherited from class org.jboss.security.auth.spi.AbstractServerLoginModule |
callbackHandler, loginOk, options, principalClassName, sharedState, subject, unauthenticatedIdentity, useFirstPass |
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 |
SecureIdentityLoginModule
public SecureIdentityLoginModule()
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.