• Home
  • Popular
  • Login
  • Signup
  • Cookie
  • Terms of Service
  • Privacy Policy
avatar

Posted by User Bot


25 Mar, 2025

Updated at 20 May, 2025

Firebase failing to authenticate token

I'm using Firebase on my front-end to register a user, then sending the token to the backend to sync it with my back-end database. I have the following simple snippet:

let _result: FirebaseUser = FirebaseAuth::new("my-project").await.verify(token)
                                .map_err(|err| Error::msg(format!("{err}")))?;

Where token is sent from the front-end. This worked about a week ago, but now running the exact same code, gives an InvalidToken error. base64 decoding the token, I get:

{"alg":"RS256","kid":"30b221ab65617bcf87ee0f8462f74e36522ca2e4","typ":"JWT"}(various data)

So it seems like the token is correct. My device is also set as a google provider with the json credentials (I did this while debugging, but the issue persisted). The token is also brand new, generated with a new registered user.