-
-
Notifications
You must be signed in to change notification settings - Fork 242
feat(backup&sync): pair social login to SRP profile #6048
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
base: main
Are you sure you want to change the base?
Conversation
- Modify AuthenticationController to get accessToken from SeedlessOnboardingController state - Add pairing logic that runs non-blocking during signIn - Add state tracking for pairing status to prevent duplicate attempts - Add PAIR_SOCIAL_IDENTIFIER endpoint for social pairing API - Ensure pairing failures don't affect other authentication flows Based on PR #6048 but using accessToken from SeedlessOnboardingController (PR #6060) instead of injecting a separate socialPairingToken.
5fbb850
to
aacb89d
Compare
5adccba
to
d90711c
Compare
@metamaskbot publish-preview |
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions.
|
cd03392
to
1df353f
Compare
…ing of seedless onboarding profiles see MetaMask/core#6048 Signed-off-by: Mircea Nistor <mirceanis@gmail.com>
…ing of seedless onboarding profiles see MetaMask/core#6048 Signed-off-by: Mircea Nistor <mirceanis@gmail.com>
…ing of seedless onboarding profiles see MetaMask/core#6048 Signed-off-by: Mircea Nistor <mirceanis@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements automatic social token pairing functionality for the AuthenticationController
to integrate with the SeedlessOnboardingController
. The implementation allows for automatic pairing of social tokens during SRP sign-in without blocking the authentication process.
- Adds social token pairing functionality to the authentication flow
- Implements state management to prevent redundant/concurrent pairing attempts
- Ensures pairing failures don't affect core authentication functionality
Reviewed Changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 8 comments.
Show a summary per file
File | Description |
---|---|
packages/profile-sync-controller/src/controllers/authentication/AuthenticationController.ts | Adds core social token pairing logic with state management |
packages/profile-sync-controller/src/sdk/authentication-jwt-bearer/flow-srp.ts | Implements the pairSocialIdentifier method for SRP authentication |
packages/profile-sync-controller/src/sdk/authentication-jwt-bearer/services.ts | Adds PAIR_SOCIAL_IDENTIFIER URL constant |
packages/profile-sync-controller/src/sdk/authentication.ts | Exposes pairSocialIdentifier method in the main authentication interface |
packages/profile-sync-controller/src/controllers/authentication/AuthenticationController.test.ts | Adds comprehensive test coverage for social pairing functionality |
packages/profile-sync-controller/src/sdk/authentication.test.ts | Adds test coverage for social identifier pairing |
packages/profile-sync-controller/src/sdk/fixtures/auth.ts | Adds mock helper for social identifier pairing endpoint |
packages/profile-sync-controller/src/sdk/mocks/auth.ts | Adds mock URL constant for social identifier pairing |
packages/profile-sync-controller/package.json | Adds seedless-onboarding-controller as peer dependency |
packages/profile-sync-controller/tsconfig.build.json | Adds TypeScript reference for seedless-onboarding-controller |
packages/profile-sync-controller/CHANGELOG.md | Documents the breaking change |
packages/profile-sync-controller/src/controllers/user-storage/UserStorageController.ts | Minor typo fix in comment |
packages/profile-sync-controller/src/controllers/authentication/AuthenticationController.ts
Outdated
Show resolved
Hide resolved
packages/profile-sync-controller/src/controllers/authentication/AuthenticationController.ts
Outdated
Show resolved
Hide resolved
packages/profile-sync-controller/src/controllers/authentication/AuthenticationController.ts
Outdated
Show resolved
Hide resolved
packages/profile-sync-controller/src/controllers/authentication/AuthenticationController.ts
Outdated
Show resolved
Hide resolved
packages/profile-sync-controller/src/controllers/authentication/AuthenticationController.ts
Outdated
Show resolved
Hide resolved
packages/profile-sync-controller/src/sdk/authentication-jwt-bearer/flow-srp.ts
Outdated
Show resolved
Hide resolved
packages/profile-sync-controller/src/sdk/authentication-jwt-bearer/flow-srp.ts
Outdated
Show resolved
Hide resolved
packages/profile-sync-controller/src/sdk/authentication-jwt-bearer/flow-srp.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Will re-review and approve when the dependencies are merged. Left a couple of tiny comments 😄
...ages/profile-sync-controller/src/controllers/authentication/AuthenticationController.test.ts
Outdated
Show resolved
Hide resolved
...ages/profile-sync-controller/src/controllers/authentication/AuthenticationController.test.ts
Outdated
Show resolved
Hide resolved
...ages/profile-sync-controller/src/controllers/authentication/AuthenticationController.test.ts
Outdated
Show resolved
Hide resolved
...ages/profile-sync-controller/src/controllers/authentication/AuthenticationController.test.ts
Outdated
Show resolved
Hide resolved
packages/profile-sync-controller/src/controllers/authentication/AuthenticationController.ts
Show resolved
Hide resolved
packages/profile-sync-controller/src/controllers/authentication/AuthenticationController.ts
Show resolved
Hide resolved
packages/profile-sync-controller/src/controllers/user-storage/UserStorageController.ts
Show resolved
Hide resolved
packages/profile-sync-controller/src/controllers/authentication/AuthenticationController.ts
Show resolved
Hide resolved
packages/profile-sync-controller/src/sdk/authentication-jwt-bearer/flow-srp.ts
Show resolved
Hide resolved
and try to use the token for automatic pairing after SRP login
…n for pairing BREAKING CHANGE: this adds @metamask/seedless-onboarding-controller as a peer dependency and requires clients to change their initialization of the controllers to allow `SeedlessOnboardingControllerGetStateAction` as well as match the build type to the `config.env` in the controller constructors.
…ngle call to pairing endpoint
d060ed2
to
3713f9f
Compare
@metamaskbot publish-preview |
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions.
|
f4a2e14
to
91d59c3
Compare
@metamaskbot publish-preview |
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions.
|
…ing of seedless onboarding profiles see MetaMask/core#6048 Signed-off-by: Mircea Nistor <mirceanis@gmail.com>
…ing of seedless onboarding profiles see MetaMask/core#6048 Signed-off-by: Mircea Nistor <mirceanis@gmail.com>
…ing of seedless onboarding profiles see MetaMask/core#6048 Signed-off-by: Mircea Nistor <mirceanis@gmail.com>
@metamaskbot publish-preview |
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions.
|
34e3922
to
0e69bd0
Compare
@metamaskbot publish-preview |
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions.
|
…ing of seedless onboarding profiles see MetaMask/core#6048 Signed-off-by: Mircea Nistor <mirceanis@gmail.com>
…ing of seedless onboarding profiles see MetaMask/core#6048 Signed-off-by: Mircea Nistor <mirceanis@gmail.com>
Explanation
This PR implements automatic social token pairing functionality for the
AuthenticationController
.This change introduces automatic pairing that:
SeedlessOnboardingController
after successful SRP sign-inBREAKING CHANGES:
SeedlessOnboardingControllerGetStateAction
in their configuration for theAuthenticationController
messengerReferences
https://consensyssoftware.atlassian.net/browse/IDENTITY-150
Changelog
Checklist