firebase / firebase/firebase-tools-ui
OAuth emulator testing does not work.
- Dominant language
- TypeScript
- Stars
- 291
- Forks
- 74
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
The documentation says that [I can mock](https://firebase.google.com/docs/emulator-suite/connect_auth#non-interactive_testing_3) signing in different users. While it works when using the `GoogleAuthProvider`, it doesn't work when using the `OAuthProvider`, even though the documentation states
> You can replace firebase.auth.GoogleAuthProvider with, for example, new firebase.auth.OAuthProvider('yahoo.com') or any other provider ID you want to mock.
**To Reproduce**
```
var provider = new OAuthProvider("google.com");
var credential = provider.credential("{\"sub\": \"abc123\", \"email\": \"foo@example.com\", \"email_verified\": true}");
```
You will get the following error `FirebaseError: Firebase: Error (auth/argument-error).`
**Expected behavior**
It should work as described in the docs..
**Desktop (please complete the following information):**
- OS: macOS
- Browser Safari
- Version 16.5.2
Contributor guide
Research direction
Start with the OAuthProvider reproduction and compare it with the working GoogleAuthProvider path described in the linked emulator documentation. Trace the auth emulator handling for the provided credential and verify the reported snippet succeeds without auth/argument-error; no source files or tests are named in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- authentication, testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100