I am implementing Js browser side code login with Fb, Amazon,Twitter,google with cognito.
Have gotten to the stage where I can get client tokens for all 4, but the problem these tokens are short-lived and expire in 1-2 hours.
Research shows Google token lasts only 1 hour, to extend life requires server-side code.
FB token lasts 2 hrs, auto-refreshes, but only while the user is logged-in. The token Will have expired next time user comes back (say after 2 days). Once again, this requires server-side code to get longer-lived token.
Amazon token is valid for 1 hour and Twitter tokens do not expire.
All help appreciated (links to documentation, experience etc.).
JS on browser (not node.js)
Using Cognito, but AFAIK it doesn't have any bearing on the life of tokens.
Corrections are also welcome.