signInWithCustomToken() with Firebase's own tokens -


i want authenticate users on multiple websites via sharing jwt token. token generated firebase, assume , valid token (tested on jwt.io , seems fine). user.gettoken().

as call signinwithcustomtoken(token) error auth/invalid-custom-token message "the custom token format incorrect. please check documentation.".

what strange, http post request https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifycustomtoken... returns http 400. have tried on both localhost , on https live website... same result. i'm using firebase 3.3.

any ideas, wrong? using feature old firebase.

you don't provide code snippets gonna speculate here.

i assuming using node.js generate custom token. try in node script: var firebase = require("firebase"); var adminconfig = { serviceaccount: "serviceaccountcredentials.json" }; var adminapp = firebase.initializeapp(adminconfig, 'admin'); var token = adminapp.auth().createcustomtoken('12345678', { customfield: 'customvalue' });

then on client try signinwithcustomtoken(token) make sure client using same api key belongs same project service account generated.


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -