Firebase Auth:
Sub Auth_TokenAvailable (User As FirebaseUser, Success As Boolean, TokenId As String)
This fires when the App is launched and the Google user is logged in. I get the TokenId and store it as a string in Process_Globals in the Starter service. I include the JWT as a parameter in all Posts to my server.
I use the Firebase SDK to validate the JWT in the server, which includes a check that the validity date/times in the claims are current, which initially they are, but after a couple of hours they have timed-out.
Should I periodically (or just before using) check the dates in my stored TokenId in my B4A app and if they are old, refresh the TokenId? I don't really want to get a new TokenId every time I call the API.
Also - how do I get the claims from the TokenId from within the B4A App (so that I can check the valid times and get a new Token if necessary)? I guess that there is a JWT parser in a B4A library somewhere but I've not found it.
Thanks in advance to anyone who can help
Last edited: