View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003933 | SOGo | Web General | public | 2016-12-08 19:50 | 2017-06-16 20:10 |
Reporter | ckreutzer | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | new | Resolution | open | ||
Platform | [Server] Linux | OS | Debian | OS Version | 8 (Jessie) |
Product Version | 3.2.4 | ||||
Summary | 0003933: SAML authentication does not work with XHR requests | ||||
Description | This is a follow-up to 0003884. I wasn't able to reopen it or comment on it. At least for SAML authentication, this is not fixed. HTTP-POST will not work because there can't be a redirect which POSTs somewhere, so this is usually done with JavaScript. So probably to resolve this issue, an implementation of HTTP-Artifact binding would be needed. | ||||
Tags | No tags attached. | ||||
Another solution would be maintaining a (local) session after verification of the assertion that is longer valid than the Assertion itself. The validation of the eventually timed out assertion can be left up to the application. Both crudesaml and my pam-script-saml have a grace parameter which could be set to the session duration. |
|
I've tried setting the Assertions validity duration to 8 hours (and checked it afterwards in the Assertion XML), but the session was gone after 5 mins again. I found out why the session times out so fast: The Assertion is saved in SOGoCache, and when validating the session on a request, the assertion is loaded from SOGoCache. However, with the default configuration the CacheInterval is set to 300 secs, so after 5 mins the Assertion is gone. Is there any possibility to make at least a workaround by saving to a less volatile storage or to increase the lifetime of only the assertions? |
|
I guess the proper solution would be: 1- increase the cache saving time for SAML2 by introducing a new parameter - like SOGoSAML2AssertionTimeout 2- add support for HTTP Artifact Binding Right now, when a XHR call is made to SOGo and the session is expired, SOGo returns HTML content and the XHR code detects that, and redirects the user to the login page. |
|
Hi ludovic, thanks for assessing that. At least point 1 would be very nice! Right now, when the IdP is returning HTML content (after the redirection from the SOGo SP part to the IdP), nothing happens in my installation (see request order in 3884). |
|
We are affected by this as well. Logging into SOGo/dovecot using SAML works nicely, it's just that after five minutes we are redirected to the IdP again. (guessing because the assetion is gone) It would be very nice if HTTP Artifact Binding could be implemented. |
|
Yes we plan on implementing that. We need to setup our SAML environment to add support for it. |
|
Nice. Thanks. |
|
Thanks Ludovic! Coming back to your comment: |
|
@ckreutzer how about when you do the same test with SOGo v2? |
|
Try tomorrow's nightly build. |
|
Hi Ludovic, I'll try it in the evening (UTC+0200) and report back. Regarding comment 11240: Haven't seen any notification for that one. I currently have no v2 test system running, but I'll try to manage that. I probably can't install them on the same machine using the repository? |
|
I tried it running the latest nightly (3.2.7.20170302-1). I let SOGoCacheInterval time out and choose another Mail in the INBOX. This is the trace for the Initiator of the "view" request in the Chrome Dev Tools... doesn't tell me much, but maybe it gives you the ability to track down how it is handled: |
|
Try again with the latest nightly build. |
|
Hi Ludovic, I tried it again today with the latest nightly (3.2.7.20170305-1). In my case, it's still not working. However I think I know what the problem is. heupink was so kind to give me a test user on his system to follow the requests. His IdP, Keycloak, returns a HTTP 401 when it isn't able to authorize via Kerberos. Then your error handler jumps in, loads the recover page in the iFrame, which is redirected, the session is refreshed and all is working again. However in my case, when the redirect from the SOGo XHR request is happening, my IdP (SimpleSAMLphp) is returning a HTTP 200 since it directly reauthorized using the cookies. Probably your error handler then doesn't kicks in, as the request was successful (however not your expected response was returned). The AuthInterceptor (UI/WebServerResources/js/Common/Common.app.js#L240) also doesn't seem to handle that: Of course the iFrame solution is more beautiful than the reload by AuthInterceptor, but I could arrange with that, too :) Example of my IdPs response:
<input type="hidden" name="SAMLResponse" value="[... Gibberish ...]" /> </body> Thanks again for giving it a try! Best regards, |
|
Just wanted to mention that in my keycloak config, kerberos authentication is switched OFF. So as it is now (and as you tested it) my keycloak is not supposed to attempt kerberos. (just thought I'd mention it) |
|
Lowering to minor. @ckreutzer - can you provide a test account for me and ssh access to a test server? I would like to see it in action. |
|
@heupink: See the following header: That's the response to the redirected view-Request (you can see that in Chrome Dev Tools). A normal browser will just show the response body (the login form or, in this case, just a JavaScript-submitted form) or if it understands Kerberos, send the ticket. @ludovic: However, I'm 90% sure I've figured the problem out above. |
|
Contact me by email, my address is all around the planet. |
|
Can I ask what the status of this bug is? Is this supposed to be fixed/implemented/finished/closed? Reason I'm asking is, that in my testing, as soon as I switch from ldap to saml2 auth, I start seeing many errors like: GLib-GObject-CRITICAL **: g_object_ref: assertion 'G_IS_OBJECT (object)' failed switching back to ldap gets rid of those. (trying with 3.2.9 currently) |
|
IIRC, it worked for you. SOGo nor SOPE does not use at all glib - so I don't know where/how that error comes from. |
|
These are coming from liblasso. Sadly, there is no real alternative to it... I've been looking for some time for a C/C++ SAML library to replace the PHP in pam_script_saml, but liblasso doesn't allow you to extract the assertion, IIRC. And all builds I patched (like the AUF guys https://wiki.auf.org/wikiteki/Projet/SOGo/TestsSAML) and built myself gave these errors, too. |
|
ah ok, thanks for explaining, ckruetzer! |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2016-12-08 19:50 | ckreutzer | New Issue | |
2016-12-12 08:15 | ckreutzer | Note Added: 0010986 | |
2016-12-13 12:28 | ckreutzer | Note Added: 0010991 | |
2016-12-28 19:48 | ludovic | Note Added: 0011120 | |
2017-01-02 08:58 | ckreutzer | Note Added: 0011160 | |
2017-01-23 09:58 | heupink | Note Added: 0011236 | |
2017-01-23 16:37 | ludovic | Note Added: 0011237 | |
2017-01-23 19:12 | heupink | Note Added: 0011238 | |
2017-01-24 17:48 | ckreutzer | Note Added: 0011239 | |
2017-01-24 17:51 | ludovic | Note Added: 0011240 | |
2017-03-01 16:24 | ludovic | Note Added: 0011399 | |
2017-03-02 06:27 | ckreutzer | Note Added: 0011405 | |
2017-03-02 19:36 | ckreutzer | Note Added: 0011407 | |
2017-03-03 14:17 | ludovic | Note Added: 0011417 | |
2017-03-05 11:59 | ckreutzer | Note Added: 0011431 | |
2017-03-05 12:01 | ckreutzer | Note Edited: 0011431 | |
2017-03-06 09:53 | heupink | Note Added: 0011432 | |
2017-03-06 16:24 | ludovic | Severity | major => minor |
2017-03-06 16:24 | ludovic | Note Added: 0011442 | |
2017-03-07 20:00 | ckreutzer | Note Added: 0011454 | |
2017-03-07 20:04 | ludovic | Note Added: 0011455 | |
2017-06-10 18:11 | heupink | Note Added: 0011915 | |
2017-06-10 18:35 | heupink | Note Edited: 0011915 | |
2017-06-16 15:37 | ludovic | Note Added: 0011968 | |
2017-06-16 15:45 | ckreutzer | Note Added: 0011971 | |
2017-06-16 20:10 | heupink | Note Added: 0011979 |