We are using Firebase with VueJS to manage sign-in to our application. And we also need to access other Google APIs using the accessToken
, unfortunatly, the token expire after one hour.
import firebase from 'firebase'
firebase.auth().signInWithPopup(provider)
.then(firebaseUser => {
var accessToken = firebaseUser.credential.accessToken;
})
How can we renew periodicaly the accessToken
in order to keep accessing other google API without having to sign-out and sign-in from Firebase ?
I've done some research and i did not find any suitable, simple solution to this issue.
Similar questions
- Application expires after 1h even when regularly reporting my activity
- Retrieve Google Access Token after authenticated using Firebase Authentication
Edit
This question is related to the refresh of accessToken
not IdToken
firebaseUser.credential:
accessToken: "ya29.GlwyBic64v6PW8......"
idToken: "eyJhbGciOiJSUzI1NiIsImt...."
providerId: "google.com"