Skip to content

Instantly share code, notes, and snippets.

@alexastrum
Created August 3, 2020 16:37
Show Gist options
  • Save alexastrum/dcc64204c8250223964d03758caefdc1 to your computer and use it in GitHub Desktop.
Save alexastrum/dcc64204c8250223964d03758caefdc1 to your computer and use it in GitHub Desktop.
const customToken = await admin
.auth()
.createCustomToken(device.data.uid, { deviceId: device.id });
const idTokenResponse = await axios.post<SignInWithCustomTokenResponse>(
"https://identitytoolkit.googleapis.com/v1/accounts:signInWithCustomToken?key=" +
WEBAPP_APIKEY,
{ token: customToken, returnSecureToken: true }
);
const idToken = idTokenResponse.data.idToken;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment