Closed Bug 1979217 Opened 3 months ago Closed 2 months ago

Handle FxA Sign-in flow in IPProtectionService

Categories

(Firefox :: IP Protection, task, P3)

task
Points:
8

Tracking

()

VERIFIED FIXED
144 Branch
Tracking Status
firefox143 --- verified
firefox144 --- verified

People

(Reporter: fchasen, Assigned: rking)

References

Details

(Whiteboard: [fx-vpn])

Attachments

(2 files)

Will need to be similar to SpecialMessageActions.fxaSignInFlow where we open a new tab a listen for the UIState to update, canceling if the tab closes but:

  • Will need to stay open at the end of the flow.
  • Will need to open the panel after a successful sign in or up.
Whiteboard: [fx-vpn]
Blocks: 1979219
No longer blocks: 1971616

Will also need to update the message CTA to use this new flow.

Since this flow will need to be handled in the panel and a cta, we should add a new action to call a method on the IPProtectionService to trigger the flow like is done here: https://searchfox.org/mozilla-central/source/toolkit/components/messaging-system/lib/SpecialMessageActions.sys.mjs#761-764

Assignee: nobody → rking

A few updates on this, thankfully we can just pass a data attribute to keep the tab open after the fxaSignInFlow so no need recreate that.

Will need to a listener in IPProtectionPanel for when IPProtectionSignedOutContentElement dispatches "IPProtection:SignIn".

Handler for that listener should call a new method on the IPProtectionService that will take a window param and use the SpecialMessageActions.fxaSignInFlow(data, browser) and if it was successful and if so open the panel. (No need to set the isSignedIn state as that will be passed in the SignedIn event).

The data will need to include autoClose: false and an extraParams: {} with entries that match what we were passing in the sign link url (but each url param as an entry in the object.

The browser is available as window.gBrowser.

We don't currently have a panel opening method, so will need to add one in the IPProtectionService that takes a window param so we open it in the current window. I used this in the demo:

  async openPanel(window) {
    let widget = lazy.CustomizableUI.getWidget(IPProtectionService.WIDGET_ID);
    let anchor = widget.forWindow(window).anchor;
    await window.PanelUI.showSubView(IPProtectionService.PANEL_ID, anchor);
  }

(You will need to import CustomizableUI add the WIDGET_ID and PANEL_ID static constant to IPProtectionService for that to work though)

Our new case in SpecialMessageActions.handleAction (like https://searchfox.org/mozilla-central/source/toolkit/components/messaging-system/lib/SpecialMessageActions.sys.mjs#777) will also need to call this new method from IPProtectionService.

Blocks: 1983078
No longer blocks: 1983078
Attachment #9506737 - Attachment description: WIP: Bug 1979217 - Handle FxA Sign-in flow in IPProtectionService → Bug 1979217 - Handle FxA Sign-in flow in IPProtectionService - r=#ip-protection-reviewers
Pushed by rking@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/97b8ffcb1f3a https://hg.mozilla.org/integration/autoland/rev/538983a6ef16 Handle FxA Sign-in flow in IPProtectionService - r=ip-protection-reviewers,fchasen
Attachment #9507654 - Flags: approval-mozilla-beta?

firefox-beta Uplift Approval Request

  • User impact if declined: Unable to access IP protection experiment
  • Code covered by automated testing: yes
  • Fix verified in Nightly: no
  • Needs manual QE test: no
  • Steps to reproduce for manual QE testing: None
  • Risk associated with taking this patch: Low
  • Explanation of risk level: Only affects IP protection experiment, which is only about 1,000 users
  • String changes made/needed: None
  • Is Android affected?: no
Status: NEW → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 144 Branch
Attachment #9507654 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

I have verified that this issue is no longer reproducible using the latest Firefox Nightly 144.0a1 and Firefox Beta 143.0b2, installed on Windows 11 x64.
Clicking the "Next" button from Signed out panel redirects user to sign in and the correct link with mentioned param is loaded.

QA Whiteboard: [qa-triage-done-c144/b143]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: