firebase admin auth token

102 views
Skip to first unread message

niztal

unread,
Mar 29, 2017, 12:27:18 AM3/29/17
to Firebase Google Group
Hi,

I got a micro services arcitecture system where some micro services may "talk" to other ones.
Anyway, I made an authentication token validation on these microservices and by using firebase admin, I wonder how can I get the firebase authentication token so I can dispatch via HTTP Authorization Header?

I tried what's written on the firebase documentation but seems like it doesn't work:

var refreshToken; // Get refresh token from OAuth2 flow

admin
.initializeApp({
  credential
: admin.credential.refreshToken(refreshToken),
  databaseURL
: "https://<DATABASE_NAME>.firebaseio.com"
});

Kato Richardson

unread,
Mar 29, 2017, 11:28:10 AM3/29/17
to Firebase Google Group
Hi Niztal,

Not really sure which refresh token you're referring to here, and why you would need to use that instead of the Auth ID token. Are you using Google Auth or Firebase Auth? If you don't know the difference between a refresh and ID token, then you probably have the Auth ID token and not a refresh token, and if you are using Firebase Auth, you probably want the Auth ID token anyway.

You may be looking for the verifyIdToken() workflow, which works together with databaseAuthVariableOverride.

☼, Kato

--
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/619a1592-1f00-4308-a19d-dd857ef4f9c8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Kato Richardson | Developer Programs Eng | kato...@google.com | 775-235-8398

Reply all
Reply to author
Forward
0 new messages