[Security & JAAS/JBoss] - Unable to get the authentication details in CustomLoginModul
by mechatronics12
Hi
I am using webauthentication and custom login module for login purpose.
How to get the login details used in webAuthentication.login(username,password) in JBoss custom login module....
I am extending my customlogin module from UsernamePasswordLoginModule class, when I use the getUserName() method in super class I am getting username as null.
I tried by extending my customloginmodule class from AbstractServerLoginModule and tried to get the username from sharedstate object, But i am getting SharedState object as null.
Please suggest me how to get the username and password in Jboss CustomLoginModule
My client is like the folowing
boolean stat=webAuthentication.login(agencyLoginForm.getUserId(), agencyLoginForm.getPassword());
System.out.println("after login+stat"+stat);
My CustomLoginModule class will be like the one
public class TPLoginModule extends UsernamePasswordLoginModule{
private Subject subject;
private CallbackHandler handler;
private Map sharedState;
private Map options;
private boolean loginOk = false;
private String username;
private String[] roles = {"admin","agent","vendor"};
private String password;
SimplePrincipal principal;
private AgencyLoginDelegate agencyLoginDelegate=new AgencyLoginDelegate();
SessionInfo sessionInfo;
public void initialize(Subject subject, CallbackHandler handler, Map sharedState, Map options) {
//super.initialize(subject, handler, sharedState, options);
System.out.println("Initialize of New TPLoginModule");
this.subject = subject;
this.handler = handler;
this.sharedState = sharedState;
this.options = options;
}
public boolean login() throws LoginException {
loginOk=false;
System.out.println("login method of New TPLoginModule");
try
{
HttpServletRequest req=(HttpServletRequest)PolicyContext.getContext("javax.servlet.http.HttpServletRequest");
//Subject caller = (Subject) PolicyContext.getContext("javax.security.auth.Subject.container");
//System.out.println("caller "+caller);
//System.out.println("caller.getPrincipals() "+caller.getPrincipals());
System.out.println("Inside daaaaaaaaaaa"+subject);
System.out.println("sharedState"+sharedState);
System.out.println("options "+options);
System.out.println("super.getUsername() "+super.getUsername());
sessionInfo = (SessionInfo)req.getSession().getAttribute("sessionInfo");
principal=new SimplePrincipal(username);
}
catch (Exception e ){
e.printStackTrace();
return false;
}
}
public boolean commit() throws LoginException {
System.out.println("commit of New TP");
if ( ! loginOk ) {
System.out.println("invalid logon Returing false from commit");
return false;
}
subject.getPrincipals().add(principal);
RDSGroup group = new RDSGroup("Roles");
for(int r = 0; r < roles.length; r ++) {
SimplePrincipal role = new SimplePrincipal(roles[r]);
group.addMember(role);
}
System.out.println("group added");
subject.getPrincipals().add(group);
return true;
}
public boolean abort() throws LoginException {
return true;
}
public boolean logout() throws LoginException {
return true;
}
protected Group[] getRoleSets() throws LoginException {
Group[] groups = {new RDSGroup("Roles")};
for(int r = 0; r < roles.length; r ++) {
SimplePrincipal role = new SimplePrincipal(roles[r]);
log.info("Found role="+roles[r]);
groups[0].addMember(role);
}
return groups;
}
/*@Override
protected Principal getIdentity() {
return principal;
}*/
@Override
protected String getUsersPassword() throws LoginException {
/*try {
InitialContext ctx = new InitialContext();
String userPath = userPathPrefix + '/' + super.getUsername();
log.info("Getting password for user="+super.getUsername());
String passwd = (String) ctx.lookup(userPath);
log.info("Found password="+passwd);
return passwd;
} catch(NamingException e) {
log.error("Failed to obtain password foruser="+super.getUsername(), e);
throw new LoginException(e.toString(true));
}
*/return null;
}
}
I have password-stacking entry in my login-config.xml as useFirstPass
Please help me
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4169187#4169187
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4169187
17 years, 10 months
[JBoss jBPM] - Re: Process state issue
by vinodkv
<?xml version="1.0" encoding="UTF-8"?>
|
| <process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="InnerProcess">
| <swimlane name="Roy">
| <assignment actor-id="admin"></assignment>
| </swimlane>
| <start-state name="Start InnerProcess">
| <task swimlane="Roy" name="Start InnerProcess"></task>
| <transition to="Done" name="one"></transition>
| </start-state>
| <task-node name="Done">
| <task swimlane="Roy" name="done"></task>
| <transition to="End" name="inINtaskNode"></transition>
| </task-node>
| <end-state name="End"></end-state>
| </process-definition>
---------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
| <process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="SubProcess">
| <swimlane name="Initiator">
| <assignment actor-id="admin"></assignment>
| </swimlane>
| <start-state name="Start SubProcess">
| <task swimlane="Initiator" name="Start SubProcess"></task>
| <transition to="InvokeTimeout" name="ok"></transition>
| </start-state>
| <process-state name="InvokeTimeout">
| <sub-process name="InnerProcess"></sub-process>
| <transition to="End"></transition>
| </process-state>
| <end-state name="End"></end-state>
| </process-definition>
---------------------------------------------------------------------------
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4169183#4169183
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4169183
17 years, 10 months
[Installation, Configuration & DEPLOYMENT] - Re: Trying to deploy Railo as war file
by am2605
No joy but I have found this in the log.
It works on 4.2.3 though...so I'm a little confused.
2008-08-07 12:54:38,031 DEBUG [org.jboss.deployers.plugins.main.MainDeployerImpl] (main) Add deployment: vfsfile:/C:/jboss/jboss-5.0.0.CR1/server/cfusion/deploy/railo.war/
| 2008-08-07 12:54:38,437 DEBUG [org.jboss.virtual.plugins.context.file.FileSystemContext] (main) IGNORING: Exception while trying to handle file (microsoft-sqljdbc.jar) as a jar through ZipEntryContext:
| java.util.zip.ZipException: error in opening zip file
| at java.util.zip.ZipFile.open(Native Method)
| at java.util.zip.ZipFile.<init>(ZipFile.java:114)
| at java.util.zip.ZipFile.<init>(ZipFile.java:131)
| at org.jboss.virtual.plugins.context.zip.ZipFileWrapper.ensureZipFile(ZipFileWrapper.java:173)
| at org.jboss.virtual.plugins.context.zip.ZipFileWrapper.acquire(ZipFileWrapper.java:239)
| at org.jboss.virtual.plugins.context.zip.ZipEntryContext.initEntries(ZipEntryContext.java:383)
| at org.jboss.virtual.plugins.context.zip.ZipEntryContext.init(ZipEntryContext.java:242)
| at org.jboss.virtual.plugins.context.zip.ZipEntryContext.<init>(ZipEntryContext.java:176)
| at org.jboss.virtual.plugins.context.zip.ZipEntryContext.mountZipFile(ZipEntryContext.java:482)
| at org.jboss.virtual.plugins.context.zip.ZipEntryContext.initEntries(ZipEntryContext.java:438)
| at org.jboss.virtual.plugins.context.zip.ZipEntryContext.init(ZipEntryContext.java:242)
| at org.jboss.virtual.plugins.context.zip.ZipEntryContext.<init>(ZipEntryContext.java:176)
| at org.jboss.virtual.plugins.context.zip.ZipEntryContext.<init>(ZipEntryContext.java:159)
| at org.jboss.virtual.plugins.context.file.FileSystemContext.mountZipFS(FileSystemContext.java:279)
| at org.jboss.virtual.plugins.context.file.FileSystemContext.createVirtualFileHandler(FileSystemContext.java:248)
| at org.jboss.virtual.plugins.context.file.FileHandler.getChildren(FileHandler.java:189)
| at org.jboss.virtual.plugins.context.AbstractVFSContext.getChildren(AbstractVFSContext.java:155)
| at org.jboss.virtual.plugins.context.AbstractVFSContext.visit(AbstractVFSContext.java:239)
| at org.jboss.virtual.plugins.context.AbstractVFSContext.visit(AbstractVFSContext.java:209)
| at org.jboss.virtual.VFS.visit(VFS.java:330)
| at org.jboss.virtual.VirtualFile.visit(VirtualFile.java:383)
| at org.jboss.virtual.VirtualFile.getChildren(VirtualFile.java:332)
| at org.jboss.deployers.vfs.plugins.structure.war.WARStructure.determineStructure(WARStructure.java:147)
| at org.jboss.deployers.vfs.plugins.structure.StructureDeployerWrapper.determineStructure(StructureDeployerWrapper.java:72)
| at org.jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl.doDetermineStructure(VFSStructuralDeployersImpl.java:196)
| at org.jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl.determineStructure(VFSStructuralDeployersImpl.java:220)
| at org.jboss.deployers.structure.spi.helpers.AbstractStructuralDeployers.determineStructure(AbstractStructuralDeployers.java:77)
| at org.jboss.deployers.plugins.main.MainDeployerImpl.determineStructure(MainDeployerImpl.java:845)
| at org.jboss.deployers.plugins.main.MainDeployerImpl.addDeployment(MainDeployerImpl.java:303)
| at org.jboss.deployers.plugins.main.MainDeployerImpl.addDeployment(MainDeployerImpl.java:260)
| at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:256)
| at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:135)
| at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:409)
| at org.jboss.Main.boot(Main.java:209)
| at org.jboss.Main$1.run(Main.java:544)
| at java.lang.Thread.run(Thread.java:619)
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4169182#4169182
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4169182
17 years, 10 months
[JBoss jBPM] - Re: Process state issue
by vinodkv
Thanks for the reply salaboy...
I tried the option of adding the late binding property to the sub process but it does not allow me to deploy the Process after that.
Thanks Ronald .........
I have checked the referencing of the subprocess and it is referencing the correct subprocess. I am also adding both the process definitions and do let me know if there are any changes required in them.
===============================================
<?xml version="1.0" encoding="UTF-8"?>
<process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="InnerProcess">
<assignment actor-id="admin">
<start-state name="Start InnerProcess">
</start-state>
<task-node name="Done">
</task-node>
<end-state name="End"></end-state>
</process-definition>
---------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="SubProcess">
<assignment actor-id="admin">
<start-state name="Start SubProcess">
</start-state>
<process-state name="InvokeTimeout">
<sub-process name="InnerProcess"></sub-process>
</process-state>
<end-state name="End"></end-state>
</process-definition>
---------------------------------------------------------------------------
Now using these definitions it goes to the Subprocess but it does not execute it. It waits for it to be signalled and it moves ahead to the next node.
What could be the solution ??
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4169181#4169181
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4169181
17 years, 10 months