I just upgraded to the new version of Firebase and I can't find where I can set the expiration duration of my Firebase authentication tokens. It used to be under the authentication section in Firebase's old layout (I had it set for 1 year). Does Firebase still have this?
Asked
Active
Viewed 5,136 times
2 Answers
5
If you keep using the Firebase 2.x SDK, your expiration period will be the same as before. You cannot change the value anymore though.
If you upgrade your code to use the 3.x SDK, it'll switch to user a never-expiring ID token and a quickly expiring access token. See this answer for more on that: Firebase authentication duration is too persistent

Community
- 1
- 1

Frank van Puffelen
- 565,676
- 79
- 828
- 807
-
Just what I was looking for. Thank you. – Holger Sindbaek Jun 20 '16 at 13:05
-
Just released the new version of my app with the new Firebase library. Seems like a lot of users are getting logged out all of the sudden. Why would that happen? – Holger Sindbaek Jun 24 '16 at 16:10
0
I am able to login to firebase using below code:
this.firebaseAuth
.auth.signInWithCustomToken(this.token)
.then(value => {
var that=this;
firebase.auth().currentUser.getIdToken(/* forceRefresh */ true).then(function(idToken) {
//get authorization token idToken here
}
I am able to to query firebase after login, but after refresh firebase not able to recognise the user?
I have stored token in localstorage but how to set token in angular firebase request? for below code:
this.afs.doc(
`user/${user.uid}`
).set(Object.assign({}, auser), { merge: true });

Shruti
- 75
- 10