Re: [SOGo] SOGo MySQL Authentication

2013-07-03 Thread Christian Mack
Hello Odhiambo Washington


Am 2013-06-26 14:46, schrieb Odhiambo Washington:
 
 I am almost bald trying to get authentication using mysql working. The
 difficult part is how to tell what SOGo is exactly doing (debugging) so
 that I can fix it.
 
 I have in my sogo.conf:
 
 /* MySQL Authentication */
SOGoUserSources = (
 {
 type = sql;
 canAuthenticate = YES;
 displayName = Staff Members;
 id = users;
 isAddressBook = YES;
 userPasswordAlgorithm = md5;
 viewURL
 =mysql://exim4u:XXX@127.0.0.1:3306/exim4u/sogo_auth_view
 http://exim4u:XXX@127.0.0.1:3306/exim4u/sogo_auth_view;
 }
   );
 
 
 And I created a view on my DB as follows:
 
 CREATE VIEW sogo_auth_view AS SELECT user_id AS sogo_id, username AS
 c_uid, realname AS c_name, clear AS c_password, username AS c_cn, use
 rname AS mail, realname AS displayName FROM users WHERE enabled='1';
 
 Which gives me:
 mysql select * from exim4u.sogo_auth_view where c_name like '%wash%';
 +-+-+-++-+-+-+
 | sogo_id | c_uid   | c_name  | c_password |
 c_cn| mail| displayName |
 +-+-+-++-+-+-+
 |   3 | w...@kictanet.or.ke mailto:w...@kictanet.or.ke | Odhiambo
 WASHINGTON | secret1| w...@kictanet.or.ke
 mailto:w...@kictanet.or.ke | w...@kictanet.or.ke
 mailto:w...@kictanet.or.ke | Odhiambo WASHINGTON |
 +-+-+-++-+-+-+
 
 
 I am trying to login using username=w...@kictanet.or.ke
 mailto:w...@kictanet.or.ke and password=whateveritis but I always get
 failure... wrong username or password.
 
 .. 
 
 Is there something I am doing wrong?? Is it wrong password format? 
 

In your SOGo configuration you say userPasswordAlgorithm = md5, but it
seems you have plain text passwords in your Mysql view.
Is that correct?
Then just use md5 hashed passwords in your view and it should work.

 My assumption is that SOGo is supposed to be sending these login details
 to my IMAP (Dovecot), right? Looking at my dovecot logs, I see no
 connection attempts...
 

It will do that, but it will check your username and password against
the mysql view first.
As that isn't working, it will not try to connect to the IMAP server at all.


Kind regards,
Christian Mack


-- 
Christian Mack
Gruppe Informationsdienste
Rechenzentrum Universität Konstanz
-- 
users@sogo.nu
https://inverse.ca/sogo/lists


Re: [SOGo] SOGo MySQL Authentication

2013-07-03 Thread Odhiambo Washington
Hi Christian,

I managed to wade past the authentication stage, actually. I used an MD5
encrypted password in that field and changed the userPasswordAlgorithm =
crypt, which worked for me after a suggestion from another member of this
list.

Thanks for the follow up.

Do you by any chance use Resource Configurations. I am at that stage of the
SOGo learning curve. I posted a question today. Hopefully you have ideas on
that too:)





On 3 July 2013 15:20, Christian Mack christian.m...@uni-konstanz.de wrote:

 Hello Odhiambo Washington


 Am 2013-06-26 14:46, schrieb Odhiambo Washington:
 
  I am almost bald trying to get authentication using mysql working. The
  difficult part is how to tell what SOGo is exactly doing (debugging) so
  that I can fix it.
 
  I have in my sogo.conf:
 
  /* MySQL Authentication */
 SOGoUserSources = (
  {
  type = sql;
  canAuthenticate = YES;
  displayName = Staff Members;
  id = users;
  isAddressBook = YES;
  userPasswordAlgorithm = md5;
  viewURL
  =mysql://exim4u:XXX@127.0.0.1:3306/exim4u/sogo_auth_view
  http://exim4u:XXX@127.0.0.1:3306/exim4u/sogo_auth_view;
  }
);
 
 
  And I created a view on my DB as follows:
 
  CREATE VIEW sogo_auth_view AS SELECT user_id AS sogo_id, username AS
  c_uid, realname AS c_name, clear AS c_password, username AS c_cn, use
  rname AS mail, realname AS displayName FROM users WHERE enabled='1';
 
  Which gives me:
  mysql select * from exim4u.sogo_auth_view where c_name like '%wash%';
 
 +-+-+-++-+-+-+
  | sogo_id | c_uid   | c_name  | c_password |
  c_cn| mail| displayName |
 
 +-+-+-++-+-+-+
  |   3 | w...@kictanet.or.ke mailto:w...@kictanet.or.ke | Odhiambo
  WASHINGTON | secret1| w...@kictanet.or.ke
  mailto:w...@kictanet.or.ke | w...@kictanet.or.ke
  mailto:w...@kictanet.or.ke | Odhiambo WASHINGTON |
 
 +-+-+-++-+-+-+
 
 
  I am trying to login using username=w...@kictanet.or.ke
  mailto:w...@kictanet.or.ke and password=whateveritis but I always get
  failure... wrong username or password.
 
  .. 
 
  Is there something I am doing wrong?? Is it wrong password format?
 

 In your SOGo configuration you say userPasswordAlgorithm = md5, but it
 seems you have plain text passwords in your Mysql view.
 Is that correct?
 Then just use md5 hashed passwords in your view and it should work.

  My assumption is that SOGo is supposed to be sending these login details
  to my IMAP (Dovecot), right? Looking at my dovecot logs, I see no
  connection attempts...
 

 It will do that, but it will check your username and password against
 the mysql view first.
 As that isn't working, it will not try to connect to the IMAP server at
 all.


 Kind regards,
 Christian Mack


 --
 Christian Mack
 Gruppe Informationsdienste
 Rechenzentrum Universität Konstanz
 --
 users@sogo.nu
 https://inverse.ca/sogo/lists




-- 
Best regards,
Odhiambo WASHINGTON,
Nairobi,KE
+254733744121/+254722743223
I can't hear you -- I'm using the scrambler.
-- 
users@sogo.nu
https://inverse.ca/sogo/lists

[SOGo] SOGo MySQL Authentication

2013-06-26 Thread Odhiambo Washington
Helloz,

I am almost bald trying to get authentication using mysql working. The
difficult part is how to tell what SOGo is exactly doing (debugging) so
that I can fix it.

I have in my sogo.conf:

/* MySQL Authentication */
   SOGoUserSources = (
{
type = sql;
canAuthenticate = YES;
displayName = Staff Members;
id = users;
isAddressBook = YES;
userPasswordAlgorithm = md5;
viewURL =mysql://
exim4u:XXX@127.0.0.1:3306/exim4u/sogo_auth_view;
}
  );


And I created a view on my DB as follows:

CREATE VIEW sogo_auth_view AS SELECT user_id AS sogo_id, username AS c_uid,
realname AS c_name, clear AS c_password, username AS c_cn, use
rname AS mail, realname AS displayName FROM users WHERE enabled='1';

Which gives me:
mysql select * from exim4u.sogo_auth_view where c_name like '%wash%';
+-+-+-++-+-+-+
| sogo_id | c_uid   | c_name  | c_password | c_cn
 | mail| displayName |
+-+-+-++-+-+-+
|   3 | w...@kictanet.or.ke | Odhiambo WASHINGTON | secret1|
w...@kictanet.or.ke | w...@kictanet.or.ke | Odhiambo WASHINGTON |
+-+-+-++-+-+-+


I am trying to login using username=w...@kictanet.or.ke and
password=whateveritis but I always get failure... wrong username or
password.

On sogo.log, I see no clue whatsoever:

root@gw:/usr/local/etc/sogo # tail -f /var/log/sogo/sogo.log
Jun 26 14:51:24 sogod [94532]: 0x0x23bdedc4[WOWatchDog] child spawned
with pid 94533
Jun 26 15:40:53 sogod [5681]: version 2.0.6a (build
r...@gw.kictanet.or.ke201306252307) -- starting
Jun 26 15:40:53 sogod [5681]: vmem size check enabled: shutting down app
when vmem  384 MB
Jun 26 15:40:53 sogod [5681]: 0x0x23c01ee4[SOGoProductLoader] SOGo
products loaded from '/usr/local/GNUstep/Local/Library/SOGo':
Jun 26 15:40:53 sogod [5681]: 0x0x23c01ee4[SOGoProductLoader]
Appointments.SOGo, Contacts.SOGo, Mailer.SOGo, CommonUI.SOGo,
ContactsUI.SOGo,
MailerUI.SOGo, MailPartViewers.SOGo, MainUI.SOGo, PreferencesUI.SOGo,
SchedulerUI.SOGo, AdministrationUI.SOGo
Jun 26 15:40:53 sogod [5681]: 0x0x23bdedc4[WOWatchDog] listening on
*:2
Jun 26 15:40:53 sogod [5681]: 0x0x23bdedc4[WOWatchDog] watchdog process
pid: 5681
Jun 26 15:40:53 sogod [5681]: 0x0x21464020[WOWatchDogChild] watchdog
request timeout set to 10 minutes
Jun 26 15:40:53 sogod [5681]: 0x0x23bdedc4[WOWatchDog] preparing 1
children
Jun 26 15:40:53 sogod [5681]: 0x0x23bdedc4[WOWatchDog] child spawned with
pid 5682
2013-06-26 15:41:06.186 sogod[5682] Note: Using UTF-8 as URL encoding in
NGExtensions.
Jun 26 15:41:06 sogod [5682]: |SOGo| starting method 'POST' on uri
'/SOGo/connect'
Jun 26 15:41:06 sogod [5682]: 0x0x23c58e54[SOGoCache] Cache cleanup
interval set every 300.00 seconds
Jun 26 15:41:06 sogod [5682]: 0x0x23c58e54[SOGoCache] Using host(s)
'localhost' as server(s)
Jun 26 15:41:10 sogod [5682]: |SOGo| lookup name: SOGo
2013-06-26 15:41:10.189 sogod[5682] Note(SoObject): SoDebugKeyLookup is
enabled!
2013-06-26 15:41:10.189 sogod[5682] Note(SoObject): SoDebugBaseURL is
enabled!
2013-06-26 15:41:10.190 sogod[5682] Note(SoObject): relative base URLs are
enabled.
Jun 26 15:41:10 sogod [5682]: |SOGo|   did not find key 'SOGo' in SoClass:
0x0x23c07504[SoObjCClass]: super=0x0x23c07184 objc=SOGo slots=connect
,GET,view,casProxy,index,saml2-signon-post,changePassword,saml2-metadata,loading,toolbar
Jun 26 15:41:10 sogod [5682]: |SOGo|   looked up value: (null)
Jun 26 15:41:10 sogod [5682]: |SOGo|   lookup in root object: (null)
Jun 26 15:41:10 sogod [5682]: |SOGo|   GOT: (null)
Jun 26 15:41:10 sogod [5682]: |SOGo|   matched appname: SOGo
Jun 26 15:41:10 sogod [5682]: |SOGo|   = rewrote value:
SOGo[0x0x23a6aba4]: name=SOGo
Jun 26 15:41:10 sogod [5682]: |SOGo| lookup name: connect
2013-06-26 15:41:10.194 sogod[5682] ERROR(-[NGBundleManager
bundleWithPath:]): could not create bundle for path:
'/usr/local/GNUstep/System/Libra
ry/Libraries/gnustep-base/Versions/1.24/Resources/SSL.bundle'
2013-06-26 15:41:10.202 sogod[5682] WOCompoundElement: pool embedding is on.
2013-06-26 15:41:10.203 sogod[5682] WOCompoundElement: id logging is on.
Jun 26 15:41:10 sogod [5682]: |SOGo|   looked up value:
0x0x23c968c4[SoPageInvocation]: class=SOGoRootPage action=connect bound
instantiated pro
duct=0x0x23c67dc4[SoProduct]: loaded code-loaded
bundle=/usr/local/GNUstep/Local/Library/SOGo/MainUI.SOGo #classes=8
#categories=4 rm=0x0x23c770
a4
Jun 26 15:41:10 sogod [5682]: |SOGo|   GOT:
0x0x23c968c4[SoPageInvocation]: class=SOGoRootPage action=connect bound
instantiated product=0x0x23
c67dc4[SoProduct]: loaded code-loaded