Re: Getting horde to authenticate against dovecot DB

Michael J Rubinsky <[email protected]> Sat, 17 Aug 2019 14:45:55 +0000
Newsgroups gmane.comp.horde.user
Message-ID <20190817144555.Horde.EDuAknHA4CRVrA_4N8oxQgm@tarn.theupstairsroom.com>
Quoting Michael J Rubinsky <[email protected]>:

> Quoting Coy Hile <[email protected]>:
>
>> Hi all,
>>
>> I'm currently trying to get Horde to authenticate against my  
>> Dovecot virtual user database, as I want the ActiveSync  
>> functionality that is missing from other solutions. However, I'm  
>> having a hard time getting the passwords in a form that both Horde  
>> and Dovecot understand.
>>
>> In the dovecot DB, I have:
>>
>>   username    |  domain  |                                           
>>                password
>> ---------------+----------+--------------------------------------------------------------------------------------------------------------------------
>> [email protected] | test.com |  
>> {SHA512-CRYPT}$6$8CK0YWwoEjEvhEwf$58UUMSvPL8fE1p50bfTjHqivp3iwmfk/2sbv9igUT0FhwRc548UaKDWBYCvgrOyDfT81u9dLEJ7ulHLFbvbSq/
>>
>>
>> conf.php contains (in relevant part):
>>
>> $conf['auth']['params']['query_auth'] = 'SELECT * FROM users WHERE  
>> username=\L AND password=\P';
>> $conf['auth']['params']['encryption'] = 'crypt-sha512';
>> $conf['auth']['params']['show_encryption'] = false;
>> $conf['auth']['driver'] = 'customsql';

Oh, and one more thing I noticed: You have show_encryption as false,  
but your password string looks like it DOES contain the encryption type.


>>
>> In syslog, one sees:
>>
>> Aug 16 21:39:23 8616546e-fcab-e37b-a25a-c746648411f7 HORDE: [horde]  
>> SQL  (0.0014s)  #012#011SELECT * FROM users WHERE  
>> username='[email protected]' AND#012#011   
>> password='$6$jCCF2GRqLkldtA6u$NMZosKqif68Ro0HjRTGy7Y/tqUuGEMYq.oZ5OqcX#012#011  NAC3PW7jMhsL.ZzdE67vjw6Bx6gIgoQh.d.3syBdYUC4j0' [pid 2321 on line 241 of  
>> "/usr/share/php/Horde/Db/Adapter/Pdo/Base.php"]
>> Aug 16 21:39:23 8616546e-fcab-e37b-a25a-c746648411f7 HORDE: [horde]  
>> FAILED LOGIN for [email protected] to horde (10.100.9.20) [pid 2321 on  
>> line 198 of "/usr/share/horde/login.php"]
>>
>> So, that brings up some questions:
>> (1) Is the data in the log actually correct? Why are there what  
>> appear to be "#012#011  " in the middle of the query?
>> (2) Am I completely taking the wrong approach here? Is there a  
>> better way to get these two things to play nice, or do I have to  
>> finesse something in the SQL queries to make this work?
>>
>> I'll probably only use this as a front end to activesync, which  
>> will talk to the same Dovecot instance eventually.
>
>
> You are probably missing the 'query_getpw' query. You need a query  
> that will load the password first, in order to get the salt before  
> we can verify the user provided password. Something like
>
> 'SELECT password FROM you_table WHERE username = \L'
>
> See towards the end of the following post for more info:
>
>
> https://theupstairsroom.com/116
>
>
>
>> Thanks,
>> -c
>>
>> -- 
>> Coy Hile
>> [email protected]
>> -- 
>> Horde mailing list
>> Frequently Asked Questions: http://horde.org/faq/
>> To unsubscribe, mail: [email protected]
>
>
>
> -- 
> mike
> The Horde Project
> http://www.horde.org
> https://www.facebook.com/hordeproject
> https://www.twitter.com/hordeproject



-- 
mike
The Horde Project
http://www.horde.org
https://www.facebook.com/hordeproject
https://www.twitter.com/hordeproject

-- 
Horde mailing list
Frequently Asked Questions: http://horde.org/faq/
To unsubscribe, mail: [email protected]
(unnamed) (application/pgp-keys, 9.1 KB) - not displayed
signature.asc (application/pgp-signature, 821 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4

iQIcBAABAgAGBQJdWBMjAAoJEJGSgkbRsxbb3s8P/1yYcaUOUYgUF7m5KuIO/vOb
0HC12V/0by8681AmTrkcGO2rXed5NhTio6ZXSwI4JCbm4HfBu4Ce/IlrTKa3wSU3
vS5BqsyU+B9/1QhF5hamgIURRIuUvxuGIT4ACNdQMJqgQUJQn64au0Qdpq+X9wlh
JFXP3VEMFSlSEkS6zuGlik2Mene5DAW1PW9CDZfChngNZ59oKVAfqKCQRjc1XtH5
imfCB5HeE1exl6pl3eTNyssJlkBd42vpxRxPhZ1FzAX9d/TSIqlUFzAvJPTcZa1W
HemRSZEtaFg7dNz3M4YQ0U5k921XFHjIHqbX1cwYRR2haBqcrMlBO5AIbkzFssTx
HEYkSB3LD1rpi3gXcfPb3EmwzV6eHwCAEfESiM5oMT3WqiQnjbjLDIVtbesl7VIO
fYo4ufvm1PNwFK0Eb2YpBMUipqNm2qYEzfleVN6XMGazC7xIsrxSvjFBCzhnipZe
DQsZPzeYigscKAqik3WN542NSEAw1HMumSOOMd8EIIGRymMIEoppCoNtSn6xzcd/
vMPvB3nuT9N5Xv6dtR3iOaxtwRPotvaMaAJ5NyuoH4UkEQxheHlaN3uhwW0MWPAX
sf+EMUnsB4xu8DZDKqh3K/3dVcHXkuDMb/HX5Sjf6T3foxgumeX5igYV0kDA9CsQ
YYihv+BEAx0/DGkwHOOR
=6Bzt
-----END PGP SIGNATURE-----