Skip to content
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

Wizard + OAuth: Make opening a new browser after clicking back works again #6591

Merged
merged 1 commit into from
Jun 19, 2018

Conversation

ogoffart
Copy link
Contributor

Issue #6574

When there is an error in the advanced page, OwncloudAdvancedSetupPage::updateStatus
(and others) call completeChanged(), which is connected to
QWizardPrivate::_q_updateButtonStates which will re-enable the back button from the
last page.

When the user click "back" and re-open the browser, the account's credentials
already have a oauth token set. So the call to the API to get a new token fails
because we use the previous token instead of using the client's secret_id.
Fix this with the HttpCredentials::DontAddCredentialsAttribute.

Now, this is still not working because the session cookies are confusing the
server. So we'll clear the cookies when re-opening the browser

@ogoffart ogoffart requested a review from ckamm June 18, 2018 10:49
@guruz guruz added this to the 2.5.0 milestone Jun 18, 2018
@guruz
Copy link
Contributor

guruz commented Jun 18, 2018

@ckamm @ogoffart Does this need to be backported to 2.4.2 too?

@ogoffart
Copy link
Contributor Author

Does this need to be backported to 2.4.2 too?

No, this is a very corner case issue. Not worth backporting IMHO.

@@ -85,6 +86,8 @@ void OAuth::start()
QString basicAuth = QString("%1:%2").arg(
Theme::instance()->oauthClientId(), Theme::instance()->oauthClientSecret());
req.setRawHeader("Authorization", "Basic " + basicAuth.toUtf8().toBase64());
// We just added the Authorization header, don't let HttpCredentialsAccessManager temper with it
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: tamper

…again

Issue #6574

When there is an error in the advanced page, OwncloudAdvancedSetupPage::updateStatus
(and others) call completeChanged(), which is connected to
QWizardPrivate::_q_updateButtonStates which will re-enable the back button from the
last page.

When the user click "back" and re-open the browser, the account's credentials
already have a oauth token set. So the call to the API to get a new token fails
because we use the previous token instead of using the client's secret_id.
Fix this with the HttpCredentials::DontAddCredentialsAttribute.

Now, this is still not working because the session cookies are confusing the
server.  So we'll clear the cookies when re-opening the browser
@ogoffart ogoffart merged commit 850dc67 into 2.5 Jun 19, 2018
@ogoffart ogoffart deleted the wizard-oauth branch June 19, 2018 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants