[Security & JAAS/JBoss] - Re: Q about login config
by jaikiran
anonymous wrote : I do not want to edit the conf/login-config.xml file in JBoss app server's path. So my Q is, is there a way I can configure my custom LoginModule without ever needing to edit the conf/login-config.xml in Jboss's path? Can I somehow provide an additional login-config.xml inside my application's path? Or is there some other way to configure the custom LoginModule so that the configuration remains completely inside the application and does not affect any of the default configuration files for the JBoss app server?
Just had a look at the JBoss source code. Looks like you can achieve this programatically. There's a MBean named XMLLoginConfigMBean. This has the following method:
/** Add an application login configuration. Any existing configuration for
| the given appName will be replaced.
| */
| public void addAppConfig(String appName, AppConfigurationEntry[] entries);
You can get the reference of this MBean programatically and invoke this method by passing the appropriate parameters. You need NOT maintain your own file containing the Login configurations.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3977123#3977123
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3977123
19 years, 7 months
[JBoss Seam] - Re: problem in a simple seam application
by mnrz
"petemuir" wrote : Please show the User class
hi, here is User class:
| package com.seam.dto;
|
| import javax.persistence.Column;
| import javax.persistence.Entity;
| import javax.persistence.Id;
| import javax.persistence.Table;
|
| import static org.jboss.seam.ScopeType.SESSION;
|
| import org.hibernate.annotations.AccessType;
| import org.jboss.seam.annotations.Name;
| import org.jboss.seam.annotations.Scope;
|
|
| @Entity
| @Name("user")
| @Table(name="user")
| @Scope(SESSION)
| @AccessType("field")
| public class User {
|
| @Id
| @Column(name="username")
| String username;
| @Column(name="password")
| String password;
| @Column(name="full_name")
| String fullName;
|
| public String getFullName() {
| return fullName;
| }
| public void setFullName(String fullName) {
| this.fullName = fullName;
| }
| public String getPassword() {
| return password;
| }
| public void setPassword(String password) {
| this.password = password;
| }
| public String getUsername() {
| return username;
| }
| public void setUsername(String username) {
| this.username = username;
| }
|
|
| }
|
|
and components.xml :
| <components>
| <component name="org.jboss.seam.core.init">
| <!-- JNDI name pattern for JBoss EJB 3.0 -->
| <property name="jndiPattern">#{ejbName}/local</property>
| </component>
| </components>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3977122#3977122
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3977122
19 years, 7 months
[Security & JAAS/JBoss] - Re: Q about login config
by jaikiran
anonymous wrote : I do not want to edit the JAVA_HOME java installation files. Is there another way to configure my custom LoginModule for java so that I do not have to physically mess around with the Java configuration. There could be other Java programs, running on the same machine, and I don't want them affected by my login.config setting. Is there another alternative way to configure the custom LoginModule for java?
This can be done programatically as follows:
System.setProperty("java.security.auth.login.config","C:/gsnxst/deploy/conf/login.config");
Write this piece of code before instantiating the LoginContext, in your standalone java program.
anonymous wrote : I do not want to edit the conf/login-config.xml file in JBoss app server's path. So my Q is, is there a way I can configure my custom LoginModule without ever needing to edit the conf/login-config.xml in Jboss's path? Can I somehow provide an additional login-config.xml inside my application's path? Or is there some other way to configure the custom LoginModule so that the configuration remains completely inside the application and does not affect any of the default configuration files for the JBoss app server?
As far as i know, there is no other option for this. You will have to edit the login-config.xml shipped by JBoss
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3977121#3977121
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3977121
19 years, 7 months