Account setup can't handle partially granted OAuth2 scopes (gmail-related)
Categories
(Thunderbird :: Account Manager, enhancement)
Tracking
(thunderbird_esr115 wontfix, thunderbird_esr128+ fixed, thunderbird130+ verified)
People
(Reporter: darktrojan, Assigned: darktrojan)
References
(Regressed 1 open bug)
Details
Attachments
(2 files, 3 obsolete files)
48 bytes,
text/x-phabricator-request
|
corey
:
approval-comm-beta+
|
Details | Review |
48 bytes,
text/x-phabricator-request
|
Details | Review |
Google is, so I'm told, going to enable OAuth2 granular permissions for Thunderbird. Our code can sort-of handle these, but we record the scopes we requested, not the ones we got. This shouldn't happen. If we save an access token and claim it has (e.g.) the CardDAV permission, but it doesn't, the CardDAV code gets confused and is unable to find any address books.
I've written a patch to fix this. To be thorough, here's what we need to test:
- When setting up a mail account, and
- granting all permissions,
- does the mail account work?
- can address books and calendars be set up in the mail setup wizard?
- can address books and calendars be set up separately after the mail setup wizard?
- granting only the mail permission,
- does the mail account work?
- can address books and calendars be set up in the mail setup wizard? (no automatic attempt should be made)
- can address books and calendars be set up separately after the mail setup wizard?
- not granting the mail permission,
- do we handle this like a cancellation of the prompt?
- not granting any permissions but accepting the prompt,
- do we handle this like a cancellation of the prompt?
- granting all permissions,
- If we set up an address book or calendar first, can we still set up mail?
In all cases, these things should work after a restart, with no additional prompts.
Assignee | ||
Comment 1•4 months ago
|
||
Updated•4 months ago
|
Assignee | ||
Comment 2•4 months ago
|
||
Comment 3•4 months ago
|
||
We will want to uplift this for 115 as well otherwise we might break profiles before they can upgrade to 128
Comment 4•4 months ago
|
||
I tested the WIP patch pretty thoroughly and these are my findings.
(In reply to Geoff Lankow (:darktrojan) [away until August 27] from comment #0)
- When setting up a mail account, and
- granting all permissions,
- does the mail account work?
YES
can address books and calendars be set up in the mail setup wizard?
YES, no further permission request is triggered
can address books and calendars be set up separately *after* the mail setup wizard?
YES, no further permission request is triggered
- granting only the mail permission,
- does the mail account work?
YES
can address books and calendars be set up in the mail setup wizard? (no automatic attempt should be made)
YES. No automatic attempt is made but if manually triggered the Google permission dialog appears only for the specific section (calendar or address book)
- can address books and calendars be set up separately *after* the mail setup wizard?
YES
- not granting the mail permission,
- do we handle this like a cancellation of the prompt?
YES, we show a warning with authentication/permission error message.
- not granting any permissions but accepting the prompt,
- do we handle this like a cancellation of the prompt?
YES, we show a warning with authentication/permission error message.
- If we set up an address book or calendar first, can we still set up mail?
YES.
The only strange thing with this last step is that when going through the email setup, Google doesn't seem to remember that I already granted permission to Contacts and Calendars, but even if I confirm the dialog without those 2 permissions unchecked, it doesn't seem to revoke them and everything still works.
Comment 5•4 months ago
•
|
||
I'll steal these patches since Geoff is on PTO and bring them to completion.
He can yell at me at MozWeek if I do something wrong.
Updated•4 months ago
|
Updated•4 months ago
|
Updated•4 months ago
|
Updated•4 months ago
|
Updated•4 months ago
|
Pushed by alessandro@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/8c451e882d81
Adjust account setup to handle partial granting of OAuth2 permission. r=tobyp
Updated•4 months ago
|
Comment 7•4 months ago
•
|
||
Comment on attachment 9414748 [details]
Bug 1909789 - Adjust account setup to handle partial granting of OAuth2 permission. r=tobyp
[Triage Comment]
Approved for beta
(2 patches)
This depends on fixes in bug 1912556 and bug 1912738.
Updated•4 months ago
|
Updated•4 months ago
|
Updated•4 months ago
|
(In reply to Corey Bryant from comment #7)
Comment on attachment 9414748 [details]
Bug 1909789 - Adjust account setup to handle partial granting of OAuth2 permission. r=tobyp[Triage Comment]
Approved for beta
(2 patches)
One patch hasn't been reviewed/landed and there are two regressions, bug 1912556 and bug 1912738. Shouldn't all this be backported together?
Assignee | ||
Updated•3 months ago
|
Comment 10•3 months ago
|
||
bugherder uplift |
Comment 11•3 months ago
•
|
||
One patch hasn't been reviewed/landed and there are two regressions, bug 1912556 and bug 1912738. Shouldn't all this be backported together?
Yes, that discussion was handled in matrix and not in the bug but I'll update the bugs to be clear. Thanks!
Comment 12•3 months ago
|
||
Comment on attachment 9414748 [details]
Bug 1909789 - Adjust account setup to handle partial granting of OAuth2 permission. r=tobyp
[Triage Comment]
Approved for esr128
Approved for esr115
Comment 13•3 months ago
|
||
Needs D210712's changes to OAuth2Module.sys.mjs to avoid merge conflicts. Possibly other things from bug 1896171 as well?
Comment 14•3 months ago
|
||
First part rebased to 128 codebase, two hunks needed a small and safe tweak. Part 2 as well as all the patches in bug 1912738 and bug 1912556 apply without issue.
Comment 15•3 months ago
•
|
||
Thanks a lot for the patch, Yury! Could you submit it via Phabricator please? We don't handle Bugzilla patches anymore.
Assignee | ||
Comment 16•3 months ago
|
||
Assignee | ||
Updated•3 months ago
|
Comment 17•3 months ago
|
||
Confirming this issue as verified fixed on 130.0b2(20240816160526) and 130.0b3(20240826151843) using macOS 14 , Windows 11 and Ubuntu 22 using the STR from comment 29 from bug 1912556.
Comment 18•3 months ago
|
||
Thanks Geoff and Yury. Once this is ready for uplift, can you submit the uplift request?
I'm going to remove the approval-comm-esr128+/approval-comm-esr115+ flags for now to avoid confusion.
Comment 19•3 months ago
|
||
Comment on attachment 9414748 [details]
Bug 1909789 - Adjust account setup to handle partial granting of OAuth2 permission. r=tobyp
[Triage Comment]
Awaiting new patches for 128esr and 115esr.
Assignee | ||
Comment 20•3 months ago
|
||
Assignee | ||
Comment 21•3 months ago
|
||
Comment on attachment 9420926 [details]
WIP: Bug 1909789 - Adjust account setup to handle partial granting of OAuth2 permission. (ESR128 version)
[Approval Request Comment]
Regression caused by (bug #): Google enabling granular consent screens.
User impact if declined: OAuth credentials are recorded badly, user will be unable to add address books/calendars after the original account setup
Testing completed (on c-c, etc.): In 130.0b2 and tested there by QA. But Google are not showing the granular consent screen to beta users. Gmail and Outlook checked by me with all five patches (this bug, bug 1912738, two from bug 1912556) applied and the user agent changed so the screens show.
Risk to taking this patch (and alternatives if risky): This makes me nervous but the lack of complaints from beta users is a good sign. Alternatively we could just not patch ESR and let broken profiles be a support issue. Perhaps Google will continue to not show the granular consent screen to ESR users?
Assignee | ||
Comment 22•3 months ago
|
||
Comment on attachment 9421161 [details]
WIP: Bug 1909789 - Test that scopes modified during OAuth2 authentication are saved correctly. (ESR128 version)
[Approval Request Comment]
See comment 21.
Updated•3 months ago
|
Updated•2 months ago
|
Updated•2 months ago
|
Updated•2 months ago
|
Comment 23•2 months ago
|
||
Comment on attachment 9420926 [details]
WIP: Bug 1909789 - Adjust account setup to handle partial granting of OAuth2 permission. (ESR128 version)
[Triage Comment]
Approved for esr128.
Chatted with Geoff and while there is still risk, we'd like to get this in while the 128 user base is still somewhat low.
Comment 24•2 months ago
|
||
Comment on attachment 9421161 [details]
WIP: Bug 1909789 - Test that scopes modified during OAuth2 authentication are saved correctly. (ESR128 version)
[Triage Comment]
Approved for esr128
Comment 25•2 months ago
|
||
bugherder uplift |
Comment 26•2 months ago
|
||
backout bugherder uplift |
Backed out in Thunderbird 128.2.3esr:
https://hg.mozilla.org/releases/comm-esr128/rev/33d67ea25ab5
https://hg.mozilla.org/releases/comm-esr128/rev/830193ea5dee
Assignee | ||
Comment 27•2 months ago
|
||
I'm setting this (and the two other bugs) back to fixed, as that's the normal state for bugs that have landed on central. When we manage to find and resolve the problems this caused on 128, I'll make one super-patch of all the changes as I'm tired of dragging 5 patches around.
Updated•2 months ago
|
Updated•2 months ago
|
Description
•