CAS 5.3.8 - Password Management - JDBC - Password's change does not update DB

43 views
Skip to first unread message

Nicola Boldrin

unread,
May 8, 2019, 3:57:31 AM5/8/19
to CAS Community
Hi all,
I'm using CAS 5.3.8 and I'm trying to change my expired password.
I can specify my new password in form and submit it; the application shows the "Password Change Successful" message but DB is not updated.

In the debug mode I see that the method org.apereo.cas.pm.jdbc.JdbcPasswordManagementService.changeInternal(....) returns 1.

    @Override
   
public boolean changeInternal(final Credential credential, final PasswordChangeBean bean) {
       
final UsernamePasswordCredential c = (UsernamePasswordCredential) credential;
       
final PasswordEncoder encoder = PasswordEncoderUtils.newPasswordEncoder(properties.getJdbc().getPasswordEncoder());
       
final String password = encoder.encode(bean.getPassword());
       
final int count = this.jdbcTemplate.update(properties.getJdbc().getSqlChangePassword(), password, c.getId());
       
return count > 0;
   
}



What's wrong?

Thanks all.

Ray Bon

unread,
May 8, 2019, 1:13:43 PM5/8/19
to cas-...@apereo.org
Nicola,

You can get hibernate to show the sql that it is sending to the database:

This may provide some more insight into your problem.

Ray
-- 
Ray Bon
Programmer Analyst
Development Services, University Systems

Nicola Boldrin

unread,
May 9, 2019, 4:38:23 AM5/9/19
to CAS Community
Hi Ray,
I've verified that the SQL is ok. After trying the cas.authn.pm.jdbc.autocommit property needlessly, the application did work perfectly. I suppose that I had a build problem with my Eclipse.

Thanks for your suggestion.

Nicola

Martin Böhmer

unread,
May 11, 2019, 9:09:08 AM5/11/19
to CAS Community
I experienced the exact same behaviour and solved it by setting autocommit = true. Don't think it is your IDE causing the problem.

Nicola Boldrin

unread,
May 15, 2019, 9:01:24 AM5/15/19
to CAS Community
Thank you Martin.
I have repeated tests, you are right, the autocommit=true is the definitive solution to the problem.
Reply all
Reply to author
Forward
0 new messages