Password authentication addtion.

I made some changes to the authentication piece, and I'm throwing them out here incase someobody else finds them useful. We have a good sized customer database already established and their passwords were stored in mysql as md5('password'). This made moving the customers over to otrs and keeping their passwords tricky. To resolve, I made this tweak in the file: Kernel/System/CustomerAuth/DB.pm Add: use Digest::MD5 qw(md5_hex); Then go down to: ... ... if ($GetPw !~ /^.{13}$/) { # strip Salt $Salt =~ s/^\$.+?\$(.+?)\$.*$/$1/; $CryptedPw = un And insert this: if(length($GetPw) > 15) { $CryptedPw = md5_hex($Pw); } elsif ($GetPw !~ /^.{13}$/) { That way if the password is a md5 hex encoded string, the check works correctly, but will still work in the other cases as well. Means we don't care what format the password is in, the code deals with it correctly. (Well I hope I got it right :) Maybe somebody else who is trying to do a conversion from a different DB will find this useful. Also, this only changes customer auth pieces, the agent auth still doesn't deal with the md5, but we only have a few agents vs. a few thousand customer accounts :). Laters, David Galbraith dgalb@ezbluesoftware.com EZblue Software Support Team

Hi David, many thanks for your feedback. :) Did you tried it with OTRS 2.2 beta? There is md5 support of passwords (agent and customer) already implemented. You just need to set the config option for that. :) Greetings, -Martin ((otrs)) :: OTRS GmbH :: Europaring 4 :: D - 94315 Straubing Fon: +49 (0) 9421 56818 0 :: Fax: +49 (0) 9421 56818 18 http://www.otrs.com/ :: Communication with success! David Galbraith schrieb:
I made some changes to the authentication piece, and I'm throwing them out here incase someobody else finds them useful. We have a good sized customer database already established and their passwords were stored in mysql as md5('password'). This made moving the customers over to otrs and keeping their passwords tricky.
To resolve, I made this tweak in the file: Kernel/System/CustomerAuth/DB.pm
Add: use Digest::MD5 qw(md5_hex);
Then go down to: ... ...
if ($GetPw !~ /^.{13}$/) { # strip Salt $Salt =~ s/^\$.+?\$(.+?)\$.*$/$1/; $CryptedPw = un
And insert this: if(length($GetPw) > 15) { $CryptedPw = md5_hex($Pw); } elsif ($GetPw !~ /^.{13}$/) {
That way if the password is a md5 hex encoded string, the check works correctly, but will still work in the other cases as well. Means we don't care what format the password is in, the code deals with it correctly. (Well I hope I got it right :)
Maybe somebody else who is trying to do a conversion from a different DB will find this useful. Also, this only changes customer auth pieces, the agent auth still doesn't deal with the md5, but we only have a few agents vs. a few thousand customer accounts :).
Laters, David Galbraith dgalb@ezbluesoftware.com EZblue Software Support Team _______________________________________________ OTRS mailing list: dev - Webpage: http://otrs.org/ Archive: http://lists.otrs.org/pipermail/dev To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/dev
participants (2)
-
David Galbraith
-
Martin Edenhofer