firebase / firebase/functions-samples

[DOCS] cloud_functions onCall : How can I get idToken ?

Open
#1,032 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
12.2k
Forks
3.8k
Avg merge
3d 23h
Merged PRs (30d)
1

Description

Is there no user id token in context ?

How can I get idToken ?

Client: ex
String token = await user.getIdToken();

Server

The context automagically [contains metadata](https://firebase.google.com/docs/reference/functions/providers_https_.callablecontext.html) about the request such as uid and token.

```
exports.getConfiguration = functions
.runWith({enforceAppCheck: true})
.https.onCall(async(data, context) => {

const token = context.IdToken ???
.....
}
```

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.