Invalid token format when login with signInWithCustomToken

288 views
Skip to first unread message

Javier Campaña Pulido

unread,
May 24, 2017, 12:34:02 PM5/24/17
to Firebase Google Group
we use the function signInWithCustomToken to log in our users to Firebase. From our server we generate the token using the php-jwt library (https://github.com/firebase/php-jwt) that you suggest in your documentation.

Through the "service accounts" panel we generated all the information needed (private_key, etc...) and everything worked fine. Our server returns a generated token when the user logs in and then we use it to call signInWithCustomToken to successfully identify the user.

The problem occured  after a few days of use. We touched nothing and suddenly we started receiving "Token invalid format. Please, check the documentation", code: 17000.

We have created a new "Service Account" and updated all the information on the server side code (where we generate the token) and it started working again. We really can't understand why we had to generate the account again and modify our source code.

Could you please help us understanding why our token started to fail? Will this happen in the future? There's nothing we are missing?

Many thanks in advance!

Hiranya Jayathilaka

unread,
May 25, 2017, 2:17:47 AM5/25/17
to fireba...@googlegroups.com
Hi Javier,

Can you perhaps share a code snippet? Is your code any different from the sample given at https://firebase.google.com/docs/auth/admin/create-custom-tokens ?

Thanks,
Hiranya 

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/c460bd6b-574b-4554-925d-d7b5dfb5236f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Hiranya Jayathilaka | Software Engineer | h...@google.com | 650-203-0128

Reply all
Reply to author
Forward
0 new messages