Skip to content

feat: update client id#29776

Merged
ieow merged 3 commits into
mainfrom
cw/update-clientId
May 7, 2026
Merged

feat: update client id#29776
ieow merged 3 commits into
mainfrom
cw/update-clientId

Conversation

@ieow

@ieow ieow commented May 6, 2026

Copy link
Copy Markdown
Contributor

Description

OAuth client IDs for Google and Apple sign-in (IOS_GOOGLE_CLIENT_ID, IOS_GOOGLE_REDIRECT_URI, ANDROID_GOOGLE_CLIENT_ID, ANDROID_GOOGLE_SERVER_CLIENT_ID, ANDROID_APPLE_CLIENT_ID) were previously sourced from process.env, requiring manual environment variable configuration and risking misconfiguration across different build types.

This PR moves those client IDs into the existing OAUTH_CONFIG object in config.ts, keyed by build type (development, main_prod, main_uat, main_dev, flask_prod, flask_uat, flask_dev). The constants in constants.ts now read from CURRENT_OAUTH_CONFIG instead of process.env, ensuring the correct client IDs are automatically selected based on the build type. The corresponding environment variable entries have been removed from .js.env.example.

Changelog

CHANGELOG entry: null

Related issues

Fixes:

Manual testing steps

Feature: Seedless onboarding OAuth login

  Scenario: user signs in with Google on iOS
    Given the app is built with a main production build type
    When user taps "Sign in with Google" during onboarding
    Then the Google OAuth flow uses the correct production client ID
    And the user is authenticated successfully

  Scenario: user signs in with Google on Android
    Given the app is built with a main production build type
    When user taps "Sign in with Google" during onboarding
    Then the Google OAuth flow uses the correct production server client ID
    And the user is authenticated successfully

  Scenario: user signs in with Apple on Android
    Given the app is built with a main production build type
    When user taps "Sign in with Apple" during onboarding
    Then the Apple OAuth flow uses the correct production Apple client ID
    And the user is authenticated successfully

Screenshots/Recordings

Before

After

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Medium Risk
Touches OAuth configuration used for Google/Apple login; incorrect client IDs/redirect URIs could break authentication in specific build targets despite being mostly a config refactor.

Overview
OAuth client IDs/redirect URIs are now defined per build type in OAuthLoginHandlers/config.ts and consumed via CURRENT_OAUTH_CONFIG in constants.ts, instead of being read from process.env.

The example env file removes the seedless-onboarding client ID entries, and unit tests are updated to assert against OAUTH_CONFIG.main_prod values for Android and legacy iOS Google config selection.

Reviewed by Cursor Bugbot for commit fd46114. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions

github-actions Bot commented May 6, 2026

Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbotv2 metamaskbotv2 Bot added the team-onboarding Onboarding team label May 6, 2026
@github-actions github-actions Bot added the size-S label May 6, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit c3844b5. Configure here.

Comment thread app/core/OAuthService/OAuthLoginHandlers/config.ts
},
main_prod: {
IOS_GOOGLE_CLIENT_ID:
'795351133007-jcaor637tblrlpuj29shdej3co8bu8kv.apps.googleusercontent.com',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@ieow ieow marked this pull request as ready for review May 7, 2026 02:25
@ieow ieow requested a review from a team as a code owner May 7, 2026 02:25
@github-actions github-actions Bot added size-M and removed size-S labels May 7, 2026
@github-actions

github-actions Bot commented May 7, 2026

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeSeedlessOnboarding, SmokeWalletPlatform, SmokeIdentity
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: medium
  • AI Confidence: 90%
click to see 🤖 AI reasoning details

E2E Test Selection:
The PR refactors how OAuth credentials (Google/Apple client IDs, redirect URIs) are sourced for the seedless onboarding feature. Previously these were read from environment variables (process.env.IOS_GOOGLE_CLIENT_ID, etc.), but now they are hardcoded into the OAUTH_CONFIG object per build type (development, main_prod, main_uat, main_dev, flask_prod, flask_uat, flask_dev). The .js.env.example file removes the corresponding env var definitions.

This change directly impacts:

  1. SmokeSeedlessOnboarding: The OAuth credentials used for Google and Apple social login flows are now sourced from config. If the config values are incorrect or the refactoring has a bug, all seedless onboarding flows (new user creation, existing user detection, lock/unlock, wallet reset, add SRP) would break.
  2. SmokeWalletPlatform: Per the SmokeSeedlessOnboarding tag description, wallet lifecycle events are related.
  3. SmokeIdentity: Per the SmokeSeedlessOnboarding tag description, account sync after social login is related.

The risk is medium because: the change is a straightforward refactoring (env vars → config object), the values appear correct (matching what was in .js.env.example), and unit tests have been updated to validate the new approach. However, the OAuth flow is critical for seedless onboarding users and any misconfiguration could break authentication entirely.

Performance Test Selection:
This change is purely a configuration refactoring - moving OAuth credential sourcing from environment variables to a hardcoded config object. There is no UI rendering, data loading, state management, or critical user flow performance impact. No performance tests are warranted.

View GitHub Actions results

@sonarqubecloud

sonarqubecloud Bot commented May 7, 2026

Copy link
Copy Markdown

@grvgoel81 grvgoel81 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

@ieow ieow added this pull request to the merge queue May 7, 2026
Merged via the queue into main with commit 0beac7b May 7, 2026
103 of 105 checks passed
@ieow ieow deleted the cw/update-clientId branch May 7, 2026 06:30
@github-actions github-actions Bot locked and limited conversation to collaborators May 7, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.77.0 Issue or pull request that will be included in release 7.77.0 label May 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.77.0 Issue or pull request that will be included in release 7.77.0 size-M team-onboarding Onboarding team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants