0

Specifically I'm looking to verify a token received from the client using auth.verify_id_token(..). I tried the pyrebase package however ..

AttributeError: Auth instance has no attribute 'verify_id_token'

The docs seem insufficient. A pointer to a complete example would be appreciated.

Fakeer
  • 985
  • 1
  • 13
  • 29

2 Answers2

0

From Pyrebase github-code it looks like the method to verify token is sign_in_with_custom_token(). So it should be auth.sign_in_with_custom_token(..).

Md Soleyman
  • 53
  • 1
  • 1
  • 4
0

Decided to forego the pyrbase package entirely due to extensive list of libs that must be vendored in. Instead went with firebase_admin. Seems simple to verify and retrieve the user info given the auth token:

import firebase_admin
from firebase_admin import credentials
from firebase_admin import auth

cred = credentials.Certificate("path/to/your/firebaseconfig.json")
app = firebase_admin.initialize_app(cred)

token = '<token id from client side auth>'
user_info = auth.verify_id_token(token)
Fakeer
  • 985
  • 1
  • 13
  • 29