How to make strapi accept firebase jwt

System Information
  • Strapi Version: V4
  • Operating System: Ubuntu
  • Database: MySql
  • Node Version: 18
  • NPM Version:
  • Yarn Version:

So I setup a react-native application, with react-native-firebase-auth I get the token generated but strapi wouldn’t accept it.

{"data":null,"error":{"status":400,"name":"ApplicationError","message":"400 Bad Request","details":{}}}

I noticed the JWT generated from my react-native app is a lot shorter vs the web version.

You would have to change the users-permisions plugin to allow for firebase tokens

1 Like

No idea, how to do that but thank you! :smiley: I’ll research about it

You can’t just throw a JWT at Strapi and expect it to work. You would need to set up Strapi to authenticate users through Firebase Authentication.

It’s not a core feature of Strapi, there are a few solutions to do this with a quick search engine search.

Yes exactly, So my thinking was I can use the same google provider. but this seems to only work for web browsers.

So I setup the react-native app and had firebase authentication but the jwt from this setup is not valid for the provider in strapi so it does not authenticate, it seems to require the payload which is not by default included in the jwt generated from firebase auth.

Could you find a workaround?
In that case I appreciate if you could please share it here as well :slight_smile: