Authentication failed refresh Token
See original GitHub issueI’m using Firebase Authentication 9.0.2 (Facebook, Google, email/password or anonymous) in my Android app, this part works correctly.
mAuthListener = new FirebaseAuth.AuthStateListener() {
@Override
public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {
FirebaseUser user = firebaseAuth.getCurrentUser();
if (user != null && !flagAuth) {
// User is signed in
} else if (user == null) {
// User is signed out
}
}
};
After this, I’m listening on database.getReference(".info/connected")
and database.getReference(".info/authenticated")
, first time I’m connecting these 2 values are true for all authenticated providers. When I’m restarted my application, it is always true.
final DatabaseReference refAuthenticated = database.getReference(".info/authenticated");
refAuthenticated.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
boolean connected = dataSnapshot.getValue(Boolean.class);
if (connected) {
AppLog.d("Authenticated");
});
} else {
AppLog.d("No more Authenticated");
}
}
@Override
public void onCancelled(DatabaseError databaseError) {
AppLog.d("Listener was cancelled at .info/authenticated");
}
});
But after 1 hour (when my token is expired), Firebase SDK has to refresh the token automatically but it failed with this error
pc_0 - Authentication failed: expired_token (Auth token is expired)
Or this one
pc_0 - Authentication failed: invalid_token (Invalid claim 'kid' in auth header.)
I have checked my SHA-1 key in my Firebase project and it is correct.
Anybody can help me? Thank you.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:6
- Comments:9 (1 by maintainers)
Top Results From Across the Web
Error authenticating with the refresh token due to: expired ...
Error authenticating with the refresh token due to: expired access/refresh token when I try to retrieve/deploy source from org.
Read more >Understanding Refresh Tokens - Auth0
When access tokens expire or become invalid but the application still needs to access a protected resource, the application faces the problem of...
Read more >Error authenticating the refresh token due to - Greytrix
Work around for VS Code Issue: Error authenticating the refresh token due to: expired access/refresh token. You would not find any solution ...
Read more >How do I fix the error "Refresh token missing"?
This error may occur if you have your inbox setup and connected with Google Apps. ... In some rare cases, you may run...
Read more >Azure AD refresh token is getting invalid frequently
This error is due to when refresh token can be expired due to either if the password changed for the user or the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@i have already same problem of that issue after some hour firebase not write on server but write in internal data
Same here