-
Notifications
You must be signed in to change notification settings - Fork 669
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[OAuth2] Replace GET http verb for PROPFIND on DetermineAuthTypeJob #6135
Comments
@SamuAlfageme needs documentation for use in complex scenarios. Maybe https://github.com/owncloud/oauth2/wiki/OAuth-code-Flow-Sequence-Diagram or owncloud-archive/documentation#3456 |
This is a regression in 2.4. Previously we assumed Basic auth if that request failed in some way. If we used Basic auth when the auth type can't be determined we'd restore previous behavior. It would not be correct though: In 2.4 we need the request to succeed to be able to tell whether to use Basic or OAuth.
What could be safely done is to GET first to check for shibboleth and then - if there's no shib redirect - follow up with a PROPFIND to determine if it's OAuth or Basic auth. |
@ckamm about:
I think that behavior should be preserved regardless of the request verb. Thinking about SAML-wrapped-in-OAuth scenario. @butonic whatcha' think?
The thing is, OAuth flow must have higher preference than SAML (to abstract it), if we check first for Shibboleth redirection(s), the client will open the webview and fall in that authentication flow instead of the wrapped one. |
That an important aspect I wasn't aware of yet! In the PR I run a PROPFIND and a GET in parallel. Adjusting it to give OAuth preference will be straightforward. |
With some firewalls we can't GET /remote.php/webdav/. Here we keep the GET request to detect shibboleth through the redirect pattern but then use PROPFIND to figure out the http auth method. Currently we prefer OAuth to Shibboleth to Basic auth. This also restores the fallback behavior of assuming basic auth when no auth type can be determined.
@SamuAlfageme The PR is updated to account for that. Now I'm wondering whether we should be able to upgrade shibboleth accounts to use oauth? Currently we allow switching between basic and oauth depending on what the server supports, but shib accounts will always use shibboleth. |
@ckamm hm, for now I guess this is more than enough. We had similar concerns for the "basic to OAuth" upgrade in #5848 (comment) (also see owncloud/core#29300 & owncloud/core#29324 for an account-type "forced migration") Since one of the long term plans after supporting OAuth2 in the client is to drop the QtWebkit dependency (and therefore shibboleth accounts), I'd say this would happen sooner or later, so might as well be in the near future. cc/ @michaelstingl @pmaier1 @butonic for their POV |
With some firewalls we can't GET /remote.php/webdav/. Here we keep the GET request to detect shibboleth through the redirect pattern but then use PROPFIND to figure out the http auth method. Currently we prefer OAuth to Shibboleth to Basic auth. This also restores the fallback behavior of assuming basic auth when no auth type can be determined.
Closing here as confirmed working with one of the picky-firewall setups; @ckamm's concerns in #6135 (comment)
... moved to #6198 |
Note that this issue is highly dependent on the server configuration (i.e. firewalls, extra security layers...) and does not affect most of OAuth2 server setups.
On account creation wizard, to determine the authentication type, the client performs a dummy (
GET
) request to the webdav endpoint where it checks theWWW-Authenticate
headers on the response. However It seems that some firewalls are picky on which verbs can reach that endpoint and only answers what we expect if it gets hit by aPROPFIND
. - this seems to be the original problem behind the behavior I saw on #5954 (comment)Expected behavior
As an illustrative example, here's the cURL version of the request the iOS client does right after checking
status.php
(as said, it's a "dummy" req. since we expect the server to reply w/ a 401 and the body will be ignored; the important part would be the HTTP method)Actual behavior
Coming from:
client/src/libsync/networkjobs.cpp
Lines 881 to 893 in 05c1bfb
cc/ @ogoffart
The text was updated successfully, but these errors were encountered: