[Security & JAAS/JBoss] - Re: JDBC Realm
by bjornn
Hi j2ee_junkie, Hi zurchman.
Follow me:
"j2ee_junkie" wrote : bjornn,
|
| Your problem then is your query. As I already mentioned, the sql configured in your security-domain must be specific for you database. For more details about the DatabaseServerLoginModule see http://wiki.jboss.org/wiki/Wiki.jsp?page=DatabaseServerLoginModule.
|
| cgriffith
I change my query to retrieve all columns of the user's and role's tables. look:
| <application-policy name = "jaas-webapp-domain">
| <authentication>
| <login-module code = "org.jboss.security.auth.spi.DatabaseServerLoginModule"
| flag = "required">
| <module-option name = "unauthenticatedIdentity">pirata</module-option>
| <module-option name = "dsJndiName">jdbc/jaasDS</module-option>
| <module-option name = "principalsQuery">SELECT LOGIN, PASSWORD FROM USERS WHERE LOGIN=?</module-option>
| <module-option name = "rolesQuery">SELECT LOGIN, ROLE_NAME, ROLE_GROUP FROM ROLES WHERE LOGIN=?</module-option>
| </login-module>
| </authentication>
| </application-policy>
|
Question: How jboss know what column represents the password, for example? How should it know? Same for role name... Maybe i'm missing some step in configuration...
I have modified my log4j.xml and get it when I try to login for the first time:
| 2006-08-02 16:20:35,141 TRACE [org.jboss.security.auth.login.XMLLoginConfigImpl] Begin getAppConfigurationEntry(jaas-webapp-domain), size=9
| 2006-08-02 16:20:35,141 TRACE [org.jboss.security.auth.login.XMLLoginConfigImpl] Begin getAppConfigurationEntry(jaas-webapp-domain), size=9
| 2006-08-02 16:20:35,141 TRACE [org.jboss.security.auth.login.XMLLoginConfigImpl] End getAppConfigurationEntry(jaas-webapp-domain), authInfo=AppConfigurationEntry[]:
| [0]
| LoginModule Class: org.jboss.security.auth.spi.DatabaseServerLoginModule
| ControlFlag: LoginModuleControlFlag: required
| Options:name=rolesQuery, value=SELECT LOGIN, ROLE_NAME, ROLE_GROUP FROM ROLES WHERE LOGIN=?
| name=principalsQuery, value=SELECT LOGIN, PASSWORD FROM USERS WHERE LOGIN=?
| name=unauthenticatedIdentity, value=pirata
| name=dsJndiName, value=jdbc/jaasDS
|
| 2006-08-02 16:20:35,141 TRACE [org.jboss.security.auth.login.XMLLoginConfigImpl] End getAppConfigurationEntry(jaas-webapp-domain), authInfo=AppConfigurationEntry[]:
| [0]
| LoginModule Class: org.jboss.security.auth.spi.DatabaseServerLoginModule
| ControlFlag: LoginModuleControlFlag: required
| Options:name=rolesQuery, value=SELECT LOGIN, ROLE_NAME, ROLE_GROUP FROM ROLES WHERE LOGIN=?
| name=principalsQuery, value=SELECT LOGIN, PASSWORD FROM USERS WHERE LOGIN=?
| name=unauthenticatedIdentity, value=pirata
| name=dsJndiName, value=jdbc/jaasDS
|
| 2006-08-02 16:20:35,141 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] initialize
| 2006-08-02 16:20:35,141 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] initialize
| 2006-08-02 16:20:35,157 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] Saw unauthenticatedIdentity=pirata
| 2006-08-02 16:20:35,157 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] Saw unauthenticatedIdentity=pirata
| 2006-08-02 16:20:35,157 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] DatabaseServerLoginModule, dsJndiName=jdbc/jaasDS
| 2006-08-02 16:20:35,157 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] DatabaseServerLoginModule, dsJndiName=jdbc/jaasDS
| 2006-08-02 16:20:35,157 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] principalsQuery=SELECT LOGIN, PASSWORD FROM USERS WHERE LOGIN=?
| 2006-08-02 16:20:35,157 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] principalsQuery=SELECT LOGIN, PASSWORD FROM USERS WHERE LOGIN=?
| 2006-08-02 16:20:35,157 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] rolesQuery=SELECT LOGIN, ROLE_NAME, ROLE_GROUP FROM ROLES WHERE LOGIN=?
| 2006-08-02 16:20:35,157 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] rolesQuery=SELECT LOGIN, ROLE_NAME, ROLE_GROUP FROM ROLES WHERE LOGIN=?
| 2006-08-02 16:20:35,157 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] login
| 2006-08-02 16:20:35,157 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] login
| 2006-08-02 16:20:35,157 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] abort
| 2006-08-02 16:20:35,157 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] abort
| 2006-08-02 16:20:39,105 TRACE [org.jboss.security.auth.login.XMLLoginConfigImpl] Begin getAppConfigurationEntry(jaas-webapp-domain), size=9
| 2006-08-02 16:20:39,105 TRACE [org.jboss.security.auth.login.XMLLoginConfigImpl] Begin getAppConfigurationEntry(jaas-webapp-domain), size=9
| 2006-08-02 16:20:39,105 TRACE [org.jboss.security.auth.login.XMLLoginConfigImpl] End getAppConfigurationEntry(jaas-webapp-domain), authInfo=AppConfigurationEntry[]:
| [0]
| LoginModule Class: org.jboss.security.auth.spi.DatabaseServerLoginModule
| ControlFlag: LoginModuleControlFlag: required
| Options:name=rolesQuery, value=SELECT LOGIN, ROLE_NAME, ROLE_GROUP FROM ROLES WHERE LOGIN=?
| name=principalsQuery, value=SELECT LOGIN, PASSWORD FROM USERS WHERE LOGIN=?
| name=unauthenticatedIdentity, value=pirata
| name=dsJndiName, value=jdbc/jaasDS
|
| 2006-08-02 16:20:39,105 TRACE [org.jboss.security.auth.login.XMLLoginConfigImpl] End getAppConfigurationEntry(jaas-webapp-domain), authInfo=AppConfigurationEntry[]:
| [0]
| LoginModule Class: org.jboss.security.auth.spi.DatabaseServerLoginModule
| ControlFlag: LoginModuleControlFlag: required
| Options:name=rolesQuery, value=SELECT LOGIN, ROLE_NAME, ROLE_GROUP FROM ROLES WHERE LOGIN=?
| name=principalsQuery, value=SELECT LOGIN, PASSWORD FROM USERS WHERE LOGIN=?
| name=unauthenticatedIdentity, value=pirata
| name=dsJndiName, value=jdbc/jaasDS
|
| 2006-08-02 16:20:39,105 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] initialize
| 2006-08-02 16:20:39,105 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] initialize
| 2006-08-02 16:20:39,105 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] Saw unauthenticatedIdentity=pirata
| 2006-08-02 16:20:39,105 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] Saw unauthenticatedIdentity=pirata
| 2006-08-02 16:20:39,105 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] DatabaseServerLoginModule, dsJndiName=jdbc/jaasDS
| 2006-08-02 16:20:39,105 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] DatabaseServerLoginModule, dsJndiName=jdbc/jaasDS
| 2006-08-02 16:20:39,105 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] principalsQuery=SELECT LOGIN, PASSWORD FROM USERS WHERE LOGIN=?
| 2006-08-02 16:20:39,105 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] principalsQuery=SELECT LOGIN, PASSWORD FROM USERS WHERE LOGIN=?
| 2006-08-02 16:20:39,105 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] rolesQuery=SELECT LOGIN, ROLE_NAME, ROLE_GROUP FROM ROLES WHERE LOGIN=?
| 2006-08-02 16:20:39,105 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] rolesQuery=SELECT LOGIN, ROLE_NAME, ROLE_GROUP FROM ROLES WHERE LOGIN=?
| 2006-08-02 16:20:39,105 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] login
| 2006-08-02 16:20:39,105 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] login
| 2006-08-02 16:20:39,105 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] abort
| 2006-08-02 16:20:39,105 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] abort
|
These are aditional information that I got from the moment that I change log4j.xml.
Maybe I should take the source to debug...
Excuse me for boring...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3962585#3962585
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3962585
18 years, 5 months
[JBoss Seam] - Re: where is <h:inputText> going?
by dbatcn
Gavin's responses came in while I was composing mine. Thank you for pointing out my JSF error:
"gavin.king(a)jboss.com" wrote : "#{foo}" is not a valid value-binding expression in JSF. You need to use "#{foo.someProperty}".
I changed my interface BQManager to include:
| public void setNameForNewBaz(String nameForNewBaz);
| public String getNameForNewBaz();
|
and my code for that property in class BQManagerBean to:
| @In(required=false)
| public void setNameForNewBaz(String nameForNewBaz) {
| log.debug("BQManagerBean.setNameForNewBaz(): called with arg:"+nameForNewBaz);
| this.nameForNewBaz = nameForNewBaz;
| }
| @Out(required=false)
| public String getNameForNewBaz() {
| log.debug("BQManagerBean.getNameForNewBaz(): returning:"+nameForNewBaz);
| return nameForNewBaz;
| }
| private String nameForNewBaz;
|
and the referencing part of bqmgr.xhtml to:
| <h:inputText value="#{bqManager.nameForNewBaz}"/>
|
but null is being passed to the setter multiple times as seen in this log snippet:
anonymous wrote :
| 2006-08-02 11:27:34,126 DEBUG [org.jboss.seam.jsf.SeamExtendedManagedPersistencePhaseListener] beginning transaction prior to phase: RENDER_RESPONSE(6)
| 2006-08-02 11:27:35,018 DEBUG [com.orgmob.play.BQManagerBean] BQManagerBean.setNameForNewBaz(): called with arg:null
| 2006-08-02 11:27:35,065 DEBUG [com.orgmob.play.BQManagerBean] BQManagerBean.setNameForNewBaz(): called with arg:null
| 2006-08-02 11:27:35,081 DEBUG [com.orgmob.play.BQManagerBean] BQManagerBean.setNameForNewBaz(): called with arg:null
| 2006-08-02 11:27:35,112 DEBUG [org.jboss.seam.jsf.SeamExtendedManagedPersistencePhaseListener] committing transaction after phase: RENDER_RESPONSE(6)
| 2006-08-02 11:27:35,112 DEBUG [org.jboss.seam.contexts.Lifecycle] <<< End web request
|
and the problem with no value for the "quux" variable (or null being injected?) remains.
I could give more of the log if that would be helpful. So far as I can tell, both inputText values are vanishing.
-David
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3962583#3962583
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3962583
18 years, 5 months
[JBoss Seam] - Re: @WebRemote: problem with client site instantiation of ob
by rlhr
So after registering myManager, I registered this classe:
Seam.Remoting.type.javax$faces$model$SelectItem = function() {
| this._value = null;
| this._label = null;
| Seam.Remoting.type.javax$faces$model$SelectItem.prototype.getValue = function() { return this._value; }
| Seam.Remoting.type.javax$faces$model$SelectItem.prototype.getLabel = function() { return this._label; }
| Seam.Remoting.type.javax$faces$model$SelectItem.prototype.setValue = function(_value) { this._value = _value; }
| Seam.Remoting.type.javax$faces$model$SelectItem.prototype.setLabel = function(_label) { this._label = _label; }
| }
|
| Seam.Remoting.type.javax$faces$model$SelectItem.__name = "javax.faces.model.SelectItem";
| Seam.Remoting.type.javax$faces$model$SelectItem.__metadata = [
| {field: "_value", type: "str"},
| {field: "_label", type: "str"},
| ];
|
|
| Seam.Remoting.registerType(Seam.Remoting.type.javax$faces$model$SelectItem);
|
Looking at the javascript code, it should then replace the generated stub.
Then I tried again without success...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3962582#3962582
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3962582
18 years, 5 months