Skip to content

Commit 0b2e17b

Browse files
docs(auth): guide for verify_id_token
1 parent d3bf850 commit 0b2e17b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

docs/guide/authentication.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,22 @@ claims which was previously added to that account.
113113
the next time a new token is issued.
114114

115115

116+
verify_id_token
117+
---------------
118+
119+
You can decode the Firebase ID token, and check for claims.
120+
121+
.. code-block:: python
122+
123+
# check if user is subscribed to premium
124+
claims = auth.verify_id_token(user['IdToken'])
125+
126+
if claims['premium'] is True:
127+
# Allow access to requested premium resource.
128+
pass
129+
..
130+
131+
116132
sign_in_anonymous
117133
-----------------
118134

0 commit comments

Comments
 (0)