After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 704869 - Support Kerberos authentication
Support Kerberos authentication
Status: RESOLVED FIXED
Product: evolution-ews
Classification: Other
Component: Miscellaneous / EWS Core
3.8.x
Other Linux
: Normal normal
: ---
Assigned To: Evolution EWS maintainer(s)
Evolution EWS maintainer(s)
Depends on: 587145
Blocks: 703515
 
 
Reported: 2013-07-25 13:52 UTC by David Woodhouse
Modified: 2013-09-30 11:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed ews patch (7.29 KB, patch)
2013-09-20 18:15 UTC, Milan Crha
none Details | Review
proposed eds patch (4.61 KB, patch)
2013-09-20 18:18 UTC, Milan Crha
none Details | Review
proposed ews patch ][ (7.31 KB, patch)
2013-09-20 18:26 UTC, Milan Crha
committed Details | Review
proposed eds patch ][ (5.14 KB, patch)
2013-09-24 09:22 UTC, Milan Crha
committed Details | Review

Description David Woodhouse 2013-07-25 13:52:35 UTC
We should be using Kerberos to authenticate to the server, wherever possible.
Comment 1 Milan Crha 2013-07-25 15:11:44 UTC
This is more of a duplicate of bug #587145, rather than depends on it.
Comment 2 David Woodhouse 2013-07-25 15:28:53 UTC
Well, we still have work to do on the EWS side to support it, once libsoup does.
Comment 3 Milan Crha 2013-09-20 18:15:26 UTC
Created attachment 255435 [details] [review]
proposed ews patch

for evolution-ews;

This adds kerberos authentication to EWS (it requires a change on eds side too, which just follows). I do this without libsoup's support, by reusing CamelSaslGssapi implementation.

There is one thing I do not understand, with NTLM, once the negotiation is over, the next messages on the session are served without re-authentication, but with Negotiation, the server claims that the user is not authorized and I'm forced to ask for the ticket again. This is for each single SoupMessage added into the EEwsConnection soup session. May I do anything wrong?
Comment 4 Milan Crha 2013-09-20 18:18:20 UTC
Created attachment 255437 [details] [review]
proposed eds patch

for evolution-data-server;

This publicizes API on CamelSaslGssapi, to be able to use it without actual CamelService instance. This is necessary, to be able to reuse the code in calendar and book backends.
Comment 5 Milan Crha 2013-09-20 18:26:44 UTC
Created attachment 255438 [details] [review]
proposed ews patch ][

for evolution-ews;

Oops, only one change, unref 'connection' in a dedicated thread. I've just got a crash:
> (evolution:13729): GLib-ERROR **: file gthread-posix.c: line 1162
> (g_system_thread_wait): error 'Resource deadlock avoided' during
> 'pthread_join (pt->system_thread, NULL)'
Comment 6 David Woodhouse 2013-09-20 19:09:34 UTC
Milan, I love you and I want to have your babies.

(In reply to comment #3)
 is one thing I do not understand, with NTLM, once the negotiation is
> over, the next messages on the session are served without re-authentication,
> but with Negotiation, the server claims that the user is not authorized and I'm
> forced to ask for the ticket again. This is for each single SoupMessage added
> into the EEwsConnection soup session. May I do anything wrong?

That's odd. I don't see why that ought to be the case. When I'm home from Linux Plumbers Conf next week I'll try to experiment a little with this, and read the specs and compare with libcurl etc.

Does it help if we actually start using the *cookies* the Exchange server attempts to set? And what is this 'Persistent-Auth:' header?

I see this (final message of one request, first of the next on the same socket)...

< HTTP/1.1 200 OK
< Set-Cookie: exchangecookie=793ad0b8adac4c288435a3a3ef1d3d66; expires=Sat, 20-Sep-2014 19:04:04 GMT; path=/; HttpOnly
< WWW-Authenticate: Negotiate YIGDBgkqhkiG9...
< Persistent-Auth: false
...
</s:Envelope>

(evolution:2547): camel-CRITICAL **: sasl_set_service: assertion `CAMEL_IS_SERVICE (service)' failed
> POST /EWS/Exchange.asmx HTTP/1.1
> Soup-Debug-Timestamp: 1379703845
> Soup-Debug: SoupSessionAsync 1 (0x1ba76f0), ESoapMessage 24 (0x1b8fc20), SoupSocket 1 (0x2567e10)
> Host: irsmsx103.ger.corp.intel.com
> User-Agent: Evolution/3.8.6
> Connection: Keep-Alive
> Content-Type: text/xml; charset=utf-8

(This is your patches on 3.8.5, so if you aren't seeing that same CRITICAL message then perhaps that's a backport issue)
Comment 8 Milan Crha 2013-09-23 09:21:16 UTC
(In reply to comment #6)
> (evolution:2547): camel-CRITICAL **: sasl_set_service: assertion
> `CAMEL_IS_SERVICE (service)' failed

Hrm, that might be an overlook on my side. I realized that I did not attach the same eds patch as I had in use here. I'll re-evaluate it here and update patches accordingly.

Thanks for the link too, I'll look on that.
Comment 9 Milan Crha 2013-09-24 09:19:37 UTC
(In reply to comment #7)
> http://blogs.msdn.com/b/benjaminperkins/archive/2011/10/31/kerberos-authpersistnonntlm-authentication-request-based-vs-session-based-authentication.aspx

Nice, so it's up to admins to decide, there is nothing what evo-ews can do about it. Good to know.
Comment 10 Milan Crha 2013-09-24 09:22:21 UTC
Created attachment 255611 [details] [review]
proposed eds patch ][

for evolution-data-server;

The same as before, only added check for the runtime warning to not claim when CamelSASL has set NULL 'service' (I hoped it'll not be called when I do not set it explicitly, but the GObject machinery calls it anyway, thus bad luck for me).

Anyway, with these two patches it works as expected for me. Could you give it a try on your side when you've time, and if it'll work for you too, then I'll commit for 3.12. Thanks in advance.
Comment 11 Milan Crha 2013-09-30 11:29:03 UTC
Created commit 82b0282 in eds master (3.11.1+)
Created commit 56c1b7b in ews master (3.11.1+)