On github, the useful google dev told me that
in order to create a user session, your python backend server only needs the JWT library to verify the Firebase Auth token (signature and audience) in the request and extract user information from the token payload.
I'm having trouble checking the token.
I am here; To start the migration, I did the following:
I added Firebase-Auth to the Android app, but I still have Gitkit in the app before Firebase-Auth. Now I have two login buttons, one of which fits into Firebase and one for the "almost obsolete" Gitkit.
On firebase.com, I imported the Google project into a new Firebase project, so the user database is the same. I already managed to use Firebase-Auth in an Android application, I can log in as a well-known user, and I can successfully get the token that I need for my backend server by calling mFirebaseAuth.getCurrentUser().getToken(false).getResult().getToken() . It contains the same user_id as the user_id token.
Now I am trying to replace the identity-toolkit-python-client library with python-jose . Since I do not currently send the Firebase token to the backend, but only the Gitkit token, I want to test this python-jose library on the Gitkit token.
On the backend, before calling GitKit.VerifyGitkitToken() I now print the results of jose.jwt.get_unverified_header() and jose.jwt.get_unverified_claims() to check if I can see what I expect. The results are good, I can view the contents of the Gitkit token as expected.
My problem is with validation. I cannot use jose.jwt.decode() to check, because I do not know which key I need to use .
jose.jwt.decode(token, key, algorithms=None, options=None, audience=None, issuer=None, subject=None, access_token=None)
I know that the algorithm from the header and the 'aud' field are also stored in the formula, if that is any help.
Returning to the comment of engineers
check Firebase Auth token (signature and audience)
How do I do this with the information I have? I assume that the audience is the โaudโ field in the applications, but how to verify the signature?
As soon as I remove the Gitkit dependency on the server, I will continue the migration.
From what I saw, the GitKit library apparently makes an โRPCโ request to the Google server for verification, but I could be wrong.
So what will be the key for checking the Gitkit token, as well as for checking the Firebase token?