Hi Sandor,

Yes I am working on a workaround by creating a new table with usernames and 
passwords and triggers to replace strings in passwords. Will post the 
solution when done.

CREATE TRIGGER CopyNewUser
AFTER INSERT ON m_user FOR EACH ROW INSERT INTO cas_user (id, username, 
password, firstname, lastname) VALUES (NEW.id, NEW.username, 
REPLACE(NEW.password, '$2y$10$', '$2a$10$'), NEW.firstname, NEW.lastname);

https://dev.mysql.com/doc/refman/5.7/en/trigger-syntax.html

Cheers,
Christian

El martes, 3 de octubre de 2017, 10:56:06 (UTC+2), Sandor Juhasz escribió:
>
> Hey,
>
> we had the exact same issue. 
>
> You can create SQL view altering the given field.
>
> Would be interested as well in a general fix.
>
>
> On Monday, October 2, 2017 at 10:29:06 AM UTC+2, Christian Axel Schmidt 
> Dick wrote:
>>
>> Hi there,
>>
>> I have an issue between CAS and Moodle (a PHP LMS) where the passwords 
>> generated by PHP are encrypted with the fixed version of blowfish ($2y...) 
>> but in CAS 5.1.x that is using Spring security the blowfish version is not 
>> the fixed one ($2a...). Therefore I cant validate users. A manual fix is to 
>> change the $2y for $2a in the password and this works. Problem is that this 
>> can't be implemented. I've been trying to replace the Spring Security 
>> Bcrypt library for JBcrypt library <https://github.com/jeremyh/jBCrypt> but 
>> I am new to the springframework and can't make it work. Tried to add it as 
>> a dependency on the project file and in the cas config as a custom password 
>> encoder but no luck. What would be the best way to solve this? What is your 
>> advice and how should I proceed?
>> I am using CAS overlay 5.1.4
>>
>> Thanks in advance,
>> Christian
>>
>>
>> cas.authn.jdbc.query[0].sql=SELECT * FROM user WHERE username=?
>> cas.authn.jdbc.query[0].url=jdbc:mysql://localhost:3306/db
>> cas.authn.jdbc.query[0].dialect=org.hibernate.dialect.MySQLDialect
>> cas.authn.jdbc.query[0].user=root
>> cas.authn.jdbc.query[0].password=password
>> cas.authn.jdbc.query[0].driverClass=com.mysql.cj.jdbc.Driver
>> cas.authn.jdbc.query[0].fieldPassword=password
>> cas.authn.jdbc.query[0].autocommit=false
>>
>> cas.authn.jdbc.query[0].passwordEncoder.type=org.mindrot.jbrcypt
>>
>> cas.authn.jdbc.query[0].passwordEncoder.encodingAlgorithm=BLOWFISH
>> cas.authn.jdbc.query[0].passwordEncoder.characterEncoding=UTF-8
>>
>>
>>

-- 
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
--- 
You received this message because you are subscribed to the Google Groups "CAS 
Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/a/apereo.org/d/msgid/cas-user/f7623b25-b25e-49d9-899b-1345287bdb09%40apereo.org.

Reply via email to