firebase / firebase/functions-samples
[DOCS] cloud_functions onCall : How can I get idToken ?
Open
- 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
Assessment
This issue has not been assessed yet.