Currently, I am working on implementing browser-side JavaScript code for login with Facebook, Amazon, Twitter, and Google using Cognito.
I have reached a point where I am able to obtain client tokens for all four platforms. However, the issue is that these tokens have a short lifespan and expire within 1-2 hours.
After conducting some research, it was discovered that Google tokens only last for 1 hour, and extending their lifespan requires server-side code.
Facebook tokens last for 2 hours but auto-refresh only when the user is actively logged in. If the user returns after two days, the token will have expired, necessitating the use of server-side code to acquire a longer-lasting token.
Amazon tokens are valid for 1 hour, while Twitter tokens do not expire at all.
Any help provided would be greatly appreciated, whether it be links to documentation or personal experiences.
Note: Working with JavaScript on the browser, not node.js
Although utilizing Cognito, it seems that it does not influence the lifespan of tokens.
Corrections and suggestions are also welcomed and encouraged.