Hi all,
Use Case: Use firebase inside China
Because China's GFW blocked all google service endpoints.
We cannot use any firebase SDKs directly which will be failed when auth with google platforms.
Instead, we build our own API server as proxy and get auth user from our server to firebase services.
case 1. create user.
-> user signup with email/password via admin.auth().createUser() on our API server
case 2. user login.
-> user login with email/password via firebase.auth().signInWithEmailAndPassword() on our API server
-> client will get accessToken and refreshToken info
case 3. use firebase REST API
-> now, we can use firebase service via the accessToken
Issue.
Before the accessToken is expired in 1 hour, I have no way to refresh the token for user.
Try 1: firebase.auth().currentUser.getToken(true)
-> not worked, because the client is not auth-ed, there is no currentUser
Try 2: pass the the accessToken and refreshToken to our API server
-> But I have no idea how to refresh auth token via nodejs SDK. There is no API for this use case.
Is there any guide about how to refresh token via API, or any way to make the expiration time of accessToken much longer ?
Thanks,
Jeff Huang