Hello everyone.
Is there for B4A a library to decode JWT like in image?
Is there for B4A a library to decode JWT like in image?
Thanks aeric!There is a code to check the JWT token expiry inside the B4J-SendTool
FirebaseNotifications - Push messages / Firebase Cloud Messaging (FCM)
Updated tutorial: https://www.b4x.com/android/forum/threads/b4x-firebase-push-notifications-2023.148715/ Clarification: The nice thing about FCM is that your app doesn't need to run in order to receive messages. The FirebaseMessaging receiver will be started by the OS when a new message...www.b4x.com
Maybe it works.
Thanks!!!Ciao Luciano,
the decode is very simple
first, you need to "split" the string with the "." character
then Base64 Decode and......
eyJhbGci0iJIUzI1NiIsInR5cCI6IkpXVCJ9 = {"alg""HS256","typ":"JWT"}
eyJ0b2tlbl90eXBlIjoicmVmcmVzaCIsImV4cCI6M
TY5MjQ4MjQ1MCwiaWF0IjoxNjkyMzk2MDUwLCJq
dGki0iJkZTg20TcyMzEwOWE0MzBmYjI4YjIxODR
hZWNlODY3ZiIsInVzZXJfaWQi0jh9 = {"token_type":"refresh","exp":1692482450,"iat":1692396050,"jti""de86723109a430fb28b2184aece867f","user_id"8}
then with the first and second part of base64 datas, you need to execute a HMAC-SHA-256 and check it
I think that you don't need a library