firebase / firebase/firebase-tools

Http callable functions with `enforceAppCheck` flag set to true throw as unauthenticated in the functions emulator

Open
#5,253 3 comments 6 reactions 1 assignee Claimed by @taeold View on GitHub
emulators: functions type: bug type: feature request
Dominant language
TypeScript
Stars
4.5k
Forks
1.3k
Avg merge
1d 12h
Merged PRs (30d)
84

Description

### [REQUIRED] Environment info

**firebase-tools: 11.16.1**

**Platform: macOS**

### [REQUIRED] Test case

```ts
exports.doSomething = functions.runWith({
enforceAppCheck: true,
}).https.onCall(async (data, context) => {
// Do something
});
```

### [REQUIRED] Steps to reproduce

Call the function

### [REQUIRED] Expected behavior

The function should execute normally if authenticated. Emulated functions should not enforce app check.

### [REQUIRED] Actual behavior

Emulated function seems to enforce app check, and calls to the emulator fail

In flutter web I get:
```console
Error: [firebase_functions/unauthenticated] Unauthenticated
```

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.