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

Make ApplicationVerifier params optional in Phone Auth APIs #8366

Merged
merged 2 commits into from
Jul 31, 2024

Conversation

NhienLam
Copy link
Contributor

Discussion

  • Currently, public phone auth related functions require a reCAPTCHA v2 verifier because that’s the only attestation provider we’re supporting. Since we're adding reCAPTCHA Enterprise support and the reCAPTCHA Enterprise ENFORCE flow doesn't require a reCAPTCHA v2 token, we will make ApplicationVerifier parameter optional.
  • If ApplicationVerifier is not available in OFF mode or AUDIT fallback flow, we will throw an auth/argument-error.

Testing

Tested the Phone Auth, SMS MFA Enroll, and SMS MFA Sign-In flows with the demo app when ApplicationVerifier is not set

  • Enforce mode: Expect sendVerificationCode to be called with a reCAPTCHA Enterprise token
  • Audit mode:
    • First, expect sendVerificationCode to be called with a reCAPTCHA Enterprise token
    • If the reCAPTHCA Enterprise token flow fails, expect a fallback to reCAPTCHA v2 token, resulting in an auth/argument-error
  • Off mode: Expect a failure with auth/argument-error

@NhienLam NhienLam requested review from a team, lisajian, Xiaoshouzi-gh and sam-gc as code owners July 15, 2024 16:13
Copy link

changeset-bot bot commented Jul 15, 2024

⚠️ No Changeset found

Latest commit: c365447

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@NhienLam NhienLam changed the title Nhienlam rce phone Make ApplicationVerifier params optional in Phone Auth APIs Jul 15, 2024
@NhienLam NhienLam removed request for a team, sam-gc and lisajian July 15, 2024 16:14
@google-oss-bot
Copy link
Contributor

Size Report 1

Affected Products

  • @firebase/auth

    TypeBase (56f904c)Merge (0bdf294)Diff
    browser188 kB189 kB+174 B (+0.1%)
    esm5245 kB245 kB+174 B (+0.1%)
    module188 kB189 kB+174 B (+0.1%)
    react-native207 kB207 kB+174 B (+0.1%)
  • @firebase/auth/internal

    TypeBase (56f904c)Merge (0bdf294)Diff
    browser199 kB199 kB+174 B (+0.1%)
    esm5258 kB258 kB+174 B (+0.1%)
    module199 kB199 kB+174 B (+0.1%)
  • bundle

    TypeBase (56f904c)Merge (0bdf294)Diff
    auth (Phone)93.3 kB93.4 kB+118 B (+0.1%)
  • firebase

    TypeBase (56f904c)Merge (0bdf294)Diff
    firebase-auth-compat.js143 kB143 kB+60 B (+0.0%)
    firebase-auth.js155 kB155 kB+60 B (+0.0%)
    firebase-compat.js789 kB789 kB+60 B (+0.0%)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/cNpPDmGfLm.html

@google-oss-bot
Copy link
Contributor

Size Analysis Report 1

Affected Products

  • @firebase/auth

    • PhoneAuthProvider

      Size

      TypeBase (56f904c)Merge (0bdf294)Diff
      size50.4 kB50.5 kB+118 B (+0.2%)
      size-with-ext-deps71.9 kB72.0 kB+118 B (+0.2%)
    • linkWithPhoneNumber

      Size

      TypeBase (56f904c)Merge (0bdf294)Diff
      size51.1 kB51.2 kB+118 B (+0.2%)
      size-with-ext-deps72.7 kB72.8 kB+118 B (+0.2%)
    • reauthenticateWithPhoneNumber

      Size

      TypeBase (56f904c)Merge (0bdf294)Diff
      size51.7 kB51.9 kB+118 B (+0.2%)
      size-with-ext-deps73.3 kB73.4 kB+118 B (+0.2%)
    • signInWithPhoneNumber

      Size

      TypeBase (56f904c)Merge (0bdf294)Diff
      size51.5 kB51.6 kB+118 B (+0.2%)
      size-with-ext-deps73.1 kB73.2 kB+118 B (+0.2%)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/cezDCcJtfw.html

Copy link

@Xiaoshouzi-gh Xiaoshouzi-gh left a comment

Choose a reason for hiding this comment

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

LGTM

@NhienLam NhienLam merged commit 1dee30b into rce-phone Jul 31, 2024
37 of 39 checks passed
@NhienLam NhienLam deleted the nhienlam-rce-phone branch July 31, 2024 20:48
@firebase firebase locked and limited conversation to collaborators Aug 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants