You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Amit V Shah <as...@tagaudit.com> on 2004/09/08 20:07:46 UTC

Fulcrum - Login Fails

Hi all,

I use Fulcrum for security services. I have following code in my
LoginUser.java - Action class.

=================== CODE START ============================

            // Authenticate the user 
            try {
System.out.println("Username" + username);
System.out.println("Password" + password);

                user = usermanager.getUser(username);
System.out.println("Actual password" + user.getPassword());
                //usermanager.authenticate(user, password);
                usermanager.authenticate(user, user.getPassword());
            } catch (PasswordMismatchException pme) {
System.out.println("Exception class is-" + pme.getClass().getName());
System.out.println("Going here too !!");
                data.setMessage("Password incorrect");
                return;
            }


=================== CODE END ============================

below is the console output for that ...

=================== CONSOLE OUTPUT ==========================
Hibernate: select user0_.user_id as user_id, user0_.username as username,
user0_.password as password, user0_.public_pw as public_pw,
user0_.display_name as display_5_, user0_.expires as expires,
user0_.java_version as java_ver7_ from user user0_ where (user0_.username=?
)
Usernameturbine
Passwordturbinetest
Hibernate: select user0_.user_id as user_id, user0_.username as username,
user0_.password as password, user0_.public_pw as public_pw,
user0_.display_name as display_5_, user0_.expires as expires,
user0_.java_version as java_ver7_ from user user0_ where (user0_.username=?
)
Actual passwordturbinetest
Exception class
is-org.apache.fulcrum.security.util.PasswordMismatchException
Going here too !!
================== END CONSOLE OUTPUT =======================


the two "Hibernate:" statements are probably because Turbine asks Hibernate
to read the DB. Once for usermanager.getUser() and second time for
usermanager.authenticate() I guess ...

I have no clue why this code should fail because I am not passing my own
password at all. All I am doing is -


user = usermanager.getUser(username);
usermanager.authenticate(user, user.getPassword());

I dont know if the roles and permissions could have anything to do with
this. I dont know why this would be happening !!!!

Thanks,
Amit

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org