Is there a way to generate Firebase ID Tokens? Not Custom ones...

3,732 views
Skip to first unread message

andy....@rokdevelopment.com

unread,
Jul 18, 2017, 12:47:35 PM7/18/17
to Firebase Google Group
Hello,

Does anyone know how to create a Firebase JWT 'ID Token' so I can test my server-side authentication processes?

I can create JWT's using third-party apps, but they need a Private Key - which I don't seem to be able to get at.  

The Public Keys are available here : https://www.googleapis.com/robot/v1/metadata/x509/secur...@system.gserviceaccount.com - but they change regularly - I assume I need a Private Key as regularly as those Public ones change?  

So, I need access to my (or Google's) Firebase Private Keys to match the ever changing Public Keys (for testing) or is there another way?

Any thoughts most appreciated!

Cheers,

Hiranya Jayathilaka

unread,
Jul 18, 2017, 12:56:41 PM7/18/17
to fireba...@googlegroups.com
ID tokens can only be minted by Firebase backend servers. As you have already observed, they are signed by Google private keys. It's not entirely clear what you're trying to achieve, but there's a way to obtain an ID token from a custom token. 

You can mint a custom token using an Admin SDK, and then exchange it to an ID token by making a REST call to Google identity toolkit. See the bit of code at: https://github.com/firebase/firebase-admin-python/blob/master/integration/test_auth.py#L24

You will need the API key of your Firebase project.

Thanks,
Hiranya



On Tue, Jul 18, 2017 at 9:24 AM, <andy....@rokdevelopment.com> wrote:
Hello,

Does anyone know how to create a Firebase JWT 'ID Token' so I can test my server-side authentication processes?

I can create JWT's using third-party apps, but they need a Private Key - which I don't seem to be able to get at.  

The Public Keys are available here : https://www.googleapis.com/robot/v1/metadata/x509/securetoken@system.gserviceaccount.com - but they change regularly - I assume I need a Private Key as regularly as those Public ones change?  

So, I need access to my (or Google's) Firebase Private Keys to match the ever changing Public Keys (for testing) or is there another way?

Any thoughts most appreciated!

Cheers,

--
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/d64f25b3-276e-4115-a0ae-9f6d068c66ea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

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

andy....@rokdevelopment.com

unread,
Jul 20, 2017, 10:21:00 AM7/20/17
to Firebase Google Group
Hi Hiranya,

That's great thanks! 

I found the latest Google Identity Toolkit version in Firebase here : https://firebase.google.com/docs/reference/rest/auth/ - has all the cURL / API calls I need for this.

I can now create Firebase ID Tokens without needing to know the Private Keys that goes with the ever-changing Public Keys/Certs.

Cheers,
Andy


On Tuesday, 18 July 2017 17:56:41 UTC+1, Hiranya Jayathilaka wrote:
ID tokens can only be minted by Firebase backend servers. As you have already observed, they are signed by Google private keys. It's not entirely clear what you're trying to achieve, but there's a way to obtain an ID token from a custom token. 

You can mint a custom token using an Admin SDK, and then exchange it to an ID token by making a REST call to Google identity toolkit. See the bit of code at: https://github.com/firebase/firebase-admin-python/blob/master/integration/test_auth.py#L24

You will need the API key of your Firebase project.

Thanks,
Hiranya


On Tue, Jul 18, 2017 at 9:24 AM, <andy....@rokdevelopment.com> wrote:
Hello,

Does anyone know how to create a Firebase JWT 'ID Token' so I can test my server-side authentication processes?

I can create JWT's using third-party apps, but they need a Private Key - which I don't seem to be able to get at.  

The Public Keys are available here : https://www.googleapis.com/robot/v1/metadata/x509/securetoken@system.gserviceaccount.com - but they change regularly - I assume I need a Private Key as regularly as those Public ones change?  

So, I need access to my (or Google's) Firebase Private Keys to match the ever changing Public Keys (for testing) or is there another way?

Any thoughts most appreciated!

Cheers,

--
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-tal...@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/d64f25b3-276e-4115-a0ae-9f6d068c66ea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages