hello,i m a java fans from china.my name is
i have found there is a bug in your josso project
this bug has puzzle me several days,which had been
figured out yesterday.
en,it's like this.Original i use the easy way you
provided: just retrive credential and identity from
josso-credentials.xml and josso-users.xml
these 2 xml file,the josso is running perfetly.
but i expect retrive credential and identity from a
mysql db,so,i according to the how-to:Integrating JOSSO
with Jakarta Tomcat 5.5
change such as the jdbc driver name,driver url
but in several days i didn't run the josso well:
below is the logger info
ÐÅÏ¢(chinese mean info):
expectedPassword=7ea2bd72bfc7dabdfecc0b5760ebcf52
2006-8-30 17:48:39
org.josso.auth.scheme.UsernamePasswordAuthScheme
validateUsername
ÐÅÏ¢(it's info): Validating usernames [user1/null]
ÐÅÏ¢: _credentialsQueryString=SELECT login AS username
, password AS password FROM josso_user WHERE login = ?
006-8-31 9:04:28
org.josso.gateway.identity.service.store.db.IdentityDAO
selectCredentials
ÐÅÏ¢: ------------------------------key.getId()=user1
006-8-31 9:04:28
org.josso.gateway.identity.service.store.db.IdentityDAO
fetchCredentials
ÐÅÏ¢: cName + cValue=LOGIN___user1
006-8-31 9:04:28
org.josso.auth.scheme.UsernamePasswordAuthScheme
newCredential
ÐÅÏ¢: name+value=LOGIN___user1
006-8-31 9:04:28
org.josso.gateway.identity.service.store.db.IdentityDAO
fetchCredentials
i had try open the logger , unfortunly i don't know how
to set the logger level to "debug",(apache's logging
package i
know much few),so i had to add some "INFO" level to
your soure code ,the result is : jdbc connection had
beed retrive,and
retrive Login and password correctly,but on fetching
Credential[] actully is null!!!!!
look the code below:
class:
public class UsernamePasswordAuthScheme extends
AbstractAuthenticationScheme
method:
public Credential newCredential(String name, Object
value) {
logger.info("name+value="+name+"___"+value);
//USERNAME_CREDENTIAL_NAME=username
if
(name.equalsIgnoreCase(USERNAME_CREDENTIAL_NAME)) {
return new UsernameCredential(value);
}
i thing that is where the problem is
whatever the "login" field can't equal the static field
USERNAME_CREDENTIAL_NAME(is "username")
today i found more :
look these info:
ÐÅÏ¢: _credentialsQueryString=SELECT login AS username
, password AS password FROM josso_user WHERE login = ?
006-8-31 9:04:28
org.josso.gateway.identity.service.store.db.IdentityDAO
selectCredentials
ÐÅÏ¢: ------------------------------key.getId()=user1
006-8-31 9:04:28
org.josso.gateway.identity.service.store.db.IdentityDAO
fetchCredentials
ÐÅÏ¢: cName + cValue=LOGIN___user1
006-8-31 9:04:28
org.josso.auth.scheme.UsernamePasswordAuthScheme
newCredential
ÐÅÏ¢: name+value=LOGIN___user1
006-8-31 9:04:28
org.josso.gateway.identity.service.store.db.IdentityDAO
fetchCredentials
you see ,althrough our sql statment is SELECT login AS
username , password AS password,but we fetch "Login"
field name ,
the original field name , but the "username" field
name. i think that is the source problem is below code:
package org.josso.gateway.identity.service.store.db;
class:IdentityDAO
method:fetchCredentials()
ResultSetMetaData md = rs.getMetaData();
// Each column is a credential, the column
name is used as credential name ...
for (int i = 1 ; i <= md.getColumnCount() ;
i++) {
String cName = md.getColumnName(i);
what i want to say is although we have changed the
"login" field to "username" ,but in the
ResultSetMetaData,the field name is the
original database field name :"login"
i saw your demonstration use Oracle ,but i use Mysql
,maybe there is some different between the two db cause
the bug.
at last , your josso is a very very nice project .i'm
happy to be your tester.
Logged In: NO
i have met the same condition with you
and, the josson version is 1.5
jdbc version is mysql-connection-java 5.10
mysql version is 5.0
so , pls somebody help us