I am breaking my head on how to get the refresh token from FirebaseAuth
but cannot seem to find how.
On iOS, the equivalent is Auth.auth().currentUser?.refreshToken
. Any help is highly appreciated.
I am breaking my head on how to get the refresh token from FirebaseAuth
but cannot seem to find how.
On iOS, the equivalent is Auth.auth().currentUser?.refreshToken
. Any help is highly appreciated.
I think this is what Furkan meant to say:
Use the forceRefresh parameter. This force refreshes the token. Should only be set to true if the token is invalidated
FirebaseAuth.getInstance().currentUser!!.getIdToken(true)
Read this answer for when you should use it: https://mcmap.net/q/1350636/-firebase-when-should-i-use-refreshtoken
Read this answer https://mcmap.net/q/770368/-android-studio-get-firebase-token-from-getidtoken
Maybe you solution is use the getIdToken listener.
getIdToken(true) only if you want refresh the token
getIdToken(false) if you only want get the current
code
user.getIdToken(true).addOnSuccessListener { result ->
val token = result.token
}
firebaseUser. getIdToken() reloads your token
© 2022 - 2024 — McMap. All rights reserved.