firebase / firebase/firebase-js-sdk

`verifyPhoneNumber` errors with `auth/invalid-app-credential` only on localhost

Open
#8,387 76 comments 29 reactions 0 assignees View on GitHub
api: auth needs-attention question stack:NextJS
Dominant language
TypeScript
Stars
5.1k
Forks
1k
Avg merge
2d 21h
Merged PRs (30d)
37

Description

### Operating System

macOS Sonoma 14.2.1

### Browser Version

Chrome 126.0.6478.183

### Firebase SDK Version

10.12.4

### Firebase SDK Product:

AppCheck, Auth

### Describe your project's tooling

Next.js using firebase app check with reCAPTCHA Enterprise with configured debug app check token

### Describe the problem

On localhost `verifyPhoneNumber` calls following endpoint

`https://identitytoolkit.googleapis.com/v2/accounts/mfaSignIn:start?key=`

which returns

```
{
"error": {
"code": 400,
"message": "INVALID_APP_CREDENTIAL",
"status": "INVALID_ARGUMENT"
}
}
```

### Steps and code to reproduce issue

1. Call `verifyPhoneNumber` in multifactor authentication flow on localhost

### Important facts

- Interestingly,`verifyPhoneNumber` work perfectly fine, but stopped working couple of days ago only when developing locally on localhost
- The deployed (hosted on Vercel) even after redeployment continue to work just fine
- Similar issue reported here https://www.reddit.com/r/Firebase/comments/1e8pdcf/firebase_error_authinvalidappcredentials_in/

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.