firebase / firebase/firebase-tools

Functions v2 authType is 'unknown' when using emulator

Open
#7,450 34 comments 31 reactions 0 assignees View on GitHub
emulators: firestore type: feature request
Dominant language
TypeScript
Stars
4.5k
Forks
1.3k
Avg merge
1d 12h
Merged PRs (30d)
84

Description

### Related issues

### [REQUIRED] Version info

**node:**

v18.8.0

**firebase-functions:**
firebase function: v2

**firebase-tools:**

firebase version: 13.12.0

**firebase-admin:**

### [REQUIRED] Test case

1. Sign up to firebase auth / firestore / functions
2. Create a login page
3. Create a function that is triggered on a firestore collection write/update/delete
4. Use "onDocumentUpdatedWithAuthContext" or any of the other methods with the AuthContext
5. Notice that event.authType is unknown when developing locally using the firebase emulator after the use is logged in and authenticated

### [REQUIRED] Steps to reproduce

I haven't found any documentation about this not working in the emulator, so I suppose it happens for everybody?

### [REQUIRED] Expected behavior

I was expecting for the authType to not be unknown, and be able to retrieve the authenticated users ID using event.authId

### [REQUIRED] Actual behavior

I get this:

authType: 'unknown',
authId: 'fake-auth-id@gmail.com'

### Were you able to successfully deploy your functions?

Yes

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.