Reputation: 470
Is there a way to add firebase auth as provider to my custom backend? For my custom backend I am using directus. Directus offers to add auth providers that supports oAuth 2.0 and openID Connect (docs). But I do not know if firebase auth can be used as an oAuth provider, I did not find about it in the firebase docs.
I am using flutter for the frontend part
Upvotes: 1
Views: 1048
Reputation: 598603
Firebase does not expose OAuth tokens for its user, so you won't be able to use that integration directly. If you're allowing your users to sign in to Firebase with a social provider (Google, Facebook, etc), you can also pass that token to directus, instead of (or in addition to) signing in to Firebase with it.
Otherwise you can take the ID token that Firebase creates for the user, and verify that in your backend code. You won't be using directus' sign-in functionality in that case though.
I also recommend reading: Demystifying Firebase Auth Tokens for an explanation of Firebase's token types.
Upvotes: 3