[Security & JAAS/JBoss] - Re: JavaServer Faces and container-managed authorization not
by poesys
As I reported in my followup post, I replaced my custom login module entirely with the standard JBoss DatabaseServerLoginModule configured with queries. That works fine and authenticates, but I'm still not seeing the roles being accepted during authorization. The roles are coming back correctly from the database, I checked the spelling and stepped through the DatabseServeLoginModule code to verify that. The role "community_user" is coming from the database query and is put into the SimplePrincipal inside the Subject, and that is the role in the security-constraint in web.xml that is authorized for the myHome.faces file. It still fails to authorize and redisplays the login page.
Here is the login-config.xml code:
| <authentication>
| <!-- A JDBC based LoginModule
| LoginModule options:
| dsJndiName: The name of the DataSource of the database containing the Principals, Roles tables
| principalsQuery: The prepared statement query equivalent to:
| "select Password from Principals where PrincipalID=?"
| rolesQuery: The prepared statement query equivalent to:
| "select Role, RoleGroup from Roles where PrincipalID=?"
| -->
| <login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule" flag="required">
| <module-option name="dsJndiName">java:jdbc/ReadOnlyTairTestJTDS</module-option>
| <module-option name="principalsQuery">select ltrim(rtrim(password)) from Community where user_name=?</module-option>
| <module-option name="rolesQuery">
| SELECT "Role", 'Roles' AS RoleGroup FROM (SELECT c.user_name, 'community_user' AS "Role" FROM Person p JOIN
| Community c ON p.community_id = c.community_id UNION SELECT c.user_name, 'tair_curator' AS "Role" FROM Person p
| JOIN Community c ON p.community_id = c.community_id WHERE p.is_tair_curator = 'T' UNION SELECT c.user_name,
| 'external_curator' AS "Role" FROM Person p JOIN Community c ON p.community_id = c.community_id WHERE
| p.is_external_curator = 'T') AS Roles WHERE user_name = ?
| </module-option>
| </login-module>
| </authentication>
| </application-policy>
|
As you can see, the roles are hard-coded strings, which I've verified against the web.xml constraint (see that in the previous post).
So, what might be preventing JBoss security management from seeing the Subject?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4171576#4171576
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4171576
17 years, 8 months
[Management, JMX/JBoss] - JBOss start up class issue
by patwary_shiva
Hi all,
I want to add a startup class which should be loaded when the jboss starts up. I did some research
Which says create mbean and add it jboss-service.xml file( not sure which location).
I am using ear deployment. The class which I want o make the start up class resides in ear file under /lib directory.
I am using jboss-4.2.1.GA.
I tried to put the MBean as service in jboss-4.2.0.GA\server\servicelink\conf\ jboss-service.xml
but got no class
java.lang.ClassNotFoundException: No ClassLoaders found for JbossStartUp
Below is the code for MBean.
import org.jboss.system.ServiceMBean;
public interface JbossStartUpMBean extends ServiceMBean
{
public void init();
public void start() throws Exception;
public void stop();
public void create();
public void destroy();
public void jbossInternalLifecycle(java.lang.String s) throws java.lang.Exception;
}
2.The implemenatation class:
public class JbossStartUp
implements MBeanRegistration, JbossStartUpMBean
{
private static Log logger = LogFactory.getLog(JbossStartUp.class);
public JbossStartUp()
{
}
public ObjectName preRegister(MBeanServer server, ObjectName name)
throws Exception
{
return new ObjectName(":service=JbossStartUp");
}
public void postRegister(Boolean boolean1)
{
}
public void preDeregister()
throws Exception
{
}
public void postDeregister()
{
}
public void create()
{
}
public void start() throws Exception
{
startup();
}
public String startup()
throws Exception
{
testStartUp startup = new testStartUp();
startup.startup();
return "OK";
}
public void init()
{
}
public void stop()
{
}
public void destroy()
{
}
public String getName()
{
return null;
}
public int getState()
{
return 0;
}
public String getStateString()
{
return null;
}
Regards
shiva
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4171572#4171572
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4171572
17 years, 8 months
start up mbean for jboss
by Sadashiv Patwary
Hi all,
I want to add a startup class which should be loaded when the jboss
starts up. I did some research
Which says create mbean and add it jboss-service.xml file( not sure
which location).
I am using ear deployment. The class which I want o make the start up
class resides in ear file under /lib directory.
I am using jboss-4.2.1.GA.
I tried to put the MBean as service in
jboss-4.2.0.GA\server\servicelink\conf\ jboss-service.xml
but got no class
java.lang.ClassNotFoundException: No ClassLoaders found for JbossStartUp
Below is the code for MBean.
import org.jboss.system.ServiceMBean;
public interface JbossStartUpMBean extends ServiceMBean
{
public void init();
public void start() throws Exception;
public void stop();
public void create();
public void destroy();
public void jbossInternalLifecycle(java.lang.String s) throws
java.lang.Exception;
}
2.The implemenatation class:
public class JbossStartUp
implements MBeanRegistration, JbossStartUpMBean
{
private static Log logger = LogFactory.getLog(JbossStartUp.class);
public JbossStartUp()
{
}
public ObjectName preRegister(MBeanServer server, ObjectName name)
throws Exception
{
return new ObjectName(":service=JbossStartUp");
}
public void postRegister(Boolean boolean1)
{
}
public void preDeregister()
throws Exception
{
}
public void postDeregister()
{
}
public void create()
{
}
public void start() throws Exception
{
startup();
}
public String startup()
throws Exception
{
testStartUp startup = new testStartUp();
startup.startup();
return "OK";
}
public void init()
{
}
public void stop()
{
}
public void destroy()
{
}
public String getName()
{
return null;
}
public int getState()
{
return 0;
}
public String getStateString()
{
return null;
}
Regards
shiva
17 years, 8 months