[JNDI and Naming] - JAAS
by Sunil Dixit
Sunil Dixit [https://community.jboss.org/people/sunil_dixit] created the discussion
"JAAS"
To view the discussion, visit: https://community.jboss.org/message/801523#801523
--------------------------------------------------------------
Hi,
I want to use JAAS ( cofigured on jboss 7) module for authenticate & authrorised client program so that it can use all secured EJBs running inside the container.To configure JASS in JBOSS 7 I have done following things
1. Added "security-realm"
2. Added "security-domain"
Here are XML snippets
<security-realm name="MyJAASRealm">
<authentication>
<jaas name="MyJAAS"/>
</authentication>
</security-realm>
<security-domain name="MyJAAS" cache-type="default">
<authentication>
<login-module code="Client" flag="required">
<module-option name="usersProperties" value="${jboss.server.config.dir}/users.properties"/>
<module-option name="rolesProperties" value="${jboss.server.config.dir}/roles.properties"/>
</login-module>
</authentication>
</security-domain>
Now I have written TestClient which will use "LoginContext" to do authentication
public static void test()
{
env.put(Context.INITIAL_CONTEXT_FACTORY,"org.jboss.naming.remote.client.InitialContextFactory");
env.put(Context.PROVIDER_URL, "remote://localhost:4447");
env.put("jboss.naming.client.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT","false");
env.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
LoginContext ref = getCLMLoginContext("Sunil", "Dixit");
ref.login();
}
public static LoginContext getCLMLoginContext(final String username,final String password) throws LoginException {
final String configurationName = "MyJAAS";
CallbackHandler cbh = new CallbackHandler() {
public void handle(Callback[] callbacks) throws IOException,
UnsupportedCallbackException {
for (Callback current : callbacks) {
if (current instanceof NameCallback) {
((NameCallback) current).setName(username);
} else if (current instanceof PasswordCallback) {
((PasswordCallback) current).setPassword(password
.toCharArray());
} else {
throw new UnsupportedCallbackException(current);
}
}
}
};
Configuration config = new Configuration() {
@Override
public AppConfigurationEntry[] getAppConfigurationEntry(String name) {
if (configurationName.equals(name) == false) {
throw new IllegalArgumentException(
"Unexpected configuration name '" + name + "'");
}
Map<String, String> options = new HashMap<String, String>();
options.put("multi-threaded", "true");
options.put("restore-login-identity", "true");
AppConfigurationEntry clmEntry = new AppConfigurationEntry(
org.jboss.security.auth.spi.UsersRolesLoginModule.class.getName(),
AppConfigurationEntry.LoginModuleControlFlag.REQUIRED,
options);
return new AppConfigurationEntry[] { clmEntry };
}
};
cbh = new AppCallbackHandler("suniul", "assad".toCharArray() );
return new LoginContext(configurationName, new Subject(), cbh, config);
}
My porblem is " How should I tell that LoginContext need to use "JAAS configured on server".
If anybody know this then plz help me.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/801523#801523]
Start a new discussion in JNDI and Naming at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 1 month
[jBPM] - Re: Error changing value of Lob variable at jBPM 4.x
by zackmc
zackmc [https://community.jboss.org/people/zackmc] created the discussion
"Re: Error changing value of Lob variable at jBPM 4.x"
To view the discussion, visit: https://community.jboss.org/message/801509#801509
--------------------------------------------------------------
Same output appears in my project (jbpm 4.4) only when I change the configuration to use the current spring transactions:
<
process-engine-context>
<job-executor threads=++"1"++ idle=++"15000"++ idle-max=++"60000"++ lock-millis=++"3600000"++ />
<command-service name=++"newTxRequiredCommandService"++>
<retry-interceptor />
<environment-interceptor policy=++"requires"++ />
<spring-transaction-interceptor policy=++"requires"++ />
</command-service>
<command-service name=++"txRequiredCommandService"++>
<retry-interceptor />
<environment-interceptor />
<spring-transaction-interceptor />
</command-service>
</process-engine-context>
<transaction-context>
<transaction type=++"spring"++ />
<hibernate-session current=++"true"++ />
</transaction-context>
When I put 'requiresNew' in policy attribute it runs. But we need the jbpm tables do rollback when an exception arise in the step. I get the error in a signal method, when I set a LOB variable.
¿Can you provide any workaround to avoid this bug?
Thank you.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/801509#801509]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 1 month
[jBPM] - Re: jBPM5 Console Integration with Tomcat6
by northly xl
northly xl [https://community.jboss.org/people/northly] created the discussion
"Re: jBPM5 Console Integration with Tomcat6"
To view the discussion, visit: https://community.jboss.org/message/801502#801502
--------------------------------------------------------------
hello all:
jBPM5 Console Integration with Tomcat7 ,Appear the following error, how to return a responsibility?
org.jboss.resteasy.spi.UnhandledException: java.lang.RuntimeException: Session was not initialized, check previous errors in log
org.jboss.resteasy.core.SynchronousDispatcher.unwrapException(SynchronousDispatcher.java:345)
org.jboss.resteasy.core.SynchronousDispatcher.handleApplicationException(SynchronousDispatcher.java:321)
org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:214)
org.jboss.resteasy.core.SynchronousDispatcher.handleInvokerException(SynchronousDispatcher.java:190)
org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:534)
org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:496)
org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119)
org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208)
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55)
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.jboss.bpm.console.server.util.GWTJsonFilter.doFilter(GWTJsonFilter.java:59)
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/801502#801502]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 1 month
[jBPM] - Re: jBPM Console Server can't find WorkItem Handler Implementation
by Ashutosh Kumar
Ashutosh Kumar [https://community.jboss.org/people/ashu.itbhu] created the discussion
"Re: jBPM Console Server can't find WorkItem Handler Implementation"
To view the discussion, visit: https://community.jboss.org/message/801495#801495
--------------------------------------------------------------
In my application i have implemented a WI handler for all my DB integrations. This is working fine for in general but not in once case.
1. Lets say in my wid i have sth as return type defined
"results" : [
"DB_OPS" : new ObjectDataType("com.sample.Employee")
]
2. In my process i have defined vaiable employee as Object(com.sample.Employee)
3. In my WI handler class i have sth like
Map<String, Object> outputMap = new HashMap<String, Object>();
Employee employee = new Employee()
employee.setFirstName("Joe");
outputMap.put("DB_OPS" , (Object) employee);
manager.completeWorkItem(workItem.getId(), outputMap);
4. This is throwing error while setting value in bean ie doing operation employee.setFirstName("Joe");
5. Error :"APPLICATION ERROR: transaction still active in request with status 0"
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/801495#801495]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 1 month
[jBPM] - About jbpm 5.4 integration tomcat 7.x
by northly xl
northly xl [https://community.jboss.org/people/northly] created the discussion
"About jbpm 5.4 integration tomcat 7.x"
To view the discussion, visit: https://community.jboss.org/message/801488#801488
--------------------------------------------------------------
hi all:
jbpm 5.4 integration tomcat 7.x appear the following error? who can help me?
org.jboss.resteasy.spi.UnhandledException: java.lang.RuntimeException: Session was not initialized, check previous errors in log
org.jboss.resteasy.core.SynchronousDispatcher.unwrapException(SynchronousDispatcher.java:345)
org.jboss.resteasy.core.SynchronousDispatcher.handleApplicationException(SynchronousDispatcher.java:321)
org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:214)
org.jboss.resteasy.core.SynchronousDispatcher.handleInvokerException(SynchronousDispatcher.java:190)
org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:534)
org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:496)
org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119)
org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208)
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55)
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.jboss.bpm.console.server.util.GWTJsonFilter.doFilter(GWTJsonFilter.java:59)
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/801488#801488]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 1 month
[jBPM] - Re: Startup of task service
by roxy1987
roxy1987 [https://community.jboss.org/people/roxy1987] created the discussion
"Re: Startup of task service"
To view the discussion, visit: https://community.jboss.org/message/801459#801459
--------------------------------------------------------------
Your task service is not getting started because your roles.properties file link. Just look for the following code snippet in your build.xml
<java classname="org.jbpm.DemoTaskService" fork="true">
<classpath>
<pathelement path="${install.home}/task-service/target"/>
<path refid="classpath.human.task" />
</classpath>
</java>
And add the line *<sysproperty key="jbpm.user.group.mapping" value="file:///<+path of your jboss server+>/jboss-as-7.1.1.Final/standalone/configuration/roles.properties"/> like this :*
<sysproperty key="jbpm.user.group.mapping" value="file:///<+path of your jboss server+>/jboss-as-7.1.1.Final/standalone/configuration/roles.properties"/>
<classpath>
<pathelement path="${install.home}/task-service/target"/>
<path refid="classpath.human.task" />
</classpath>
</java>
<java classname="org.jbpm.DemoTaskService" fork="true">
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/801459#801459]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 1 month