It is not enough to only implement it for the QNAM returned
by the ShibbolethCredentials, because we sometimes need it
when we have no valid credentials set (and are using dummy
credentials in the course). The main use case is the
Webview opened by Shibboleth for FBA.
But as a side-effect, we can use it to handle auth requests
from the updater and other places.
When the url do not have a path (for example: "http://example.com" as
opposed to "http://example.com/"), its path is not a prefix of the
root path of the cookie (usually '/')
By adding the dav path, we make sure the URL has a path.
This made a bug when the owncloud url was just a domain name and did not
have a path
If we don't have the cookie in the keychain (e.g. the keychain is
unavailable) but there is still session cookie in the cookie jar,
showing the browser won't ask for authentication.
This will cause the browser window to open again after it has been told to close
if a network job has run in the background while the browser window was visible.
Fixes#1814
The shibboleth implementation no longer maintains its own QNAM.
Instead, MirallAccessManager now holds a custom QNAM implementation
which saves cookies to a file on disk.
This patch also reduces some complexity wrt the browser window,
which used to be deleted via a roundtrip to its callee, which
is not longer required.
Fixes#1764 and Enterprise bug #165
Going forward, AbstractCredentials::getQNAM() could maybe removed entirely.
If a QNAM job (e.g. Quota or ETag job) gets redirected,
we'll invalidate and then prompt to re-fetch the credentials
from the user.
(The keychain credentials will be wrong so they get deleted)
Which cookies are going to be stored are determined only when setting
up or modifying an account. Cookie handling allow us to avoid choosing
Identity Provider everytime when browser page appears.
We needed to notify shibboleth-specific QNAM about new cookie and then
stop cramming that cookie into request via setHeader, but rather put
it to cookie jar and let Qt handle the cookie insertion into requests.