1

I built a Flutter app. The main part of the app is uploading user videos. Until now I had connected Firebase cloud storage to my app. However, for cost reasons I wanted to use Backblaze as storage and Cloudflare as CDN. The question I have is: I need to provide a URL in Cloudflare, the problem with this is a Flutter app which is not a domain like a website after all. I don't quite understand how to solve this? App is written in Flutter most of the backend is Firebase. I want to use the free plan from Cloudflare.

If any questions please let me know.

metadaddy
  • 4,234
  • 1
  • 22
  • 46
Michael m.
  • 161
  • 1
  • 3
  • 13

1 Answers1

0

I work at Backblaze. I'm not an expert on Flutter or Firebase, but I did a little investigation to see if this is possible.

Firebase is more than just a storage platform. It is managing your user's accounts, and issuing ID tokens. When a user logs in, your app gets a short-lived token to use in interacting with Firebase on behalf of that user.

If you want to use a different storage platform, you will have to write your own backend. This is why...

Writing directly from your app to Backblaze B2 would mean that your app's binary contained the Backblaze credentials. An attacker could extract them from the binary and have the same access to your B2 buckets as your app has. "Apps can't keep secrets".

A custom backend can contain Backblaze B2 credentials without revealing them to an attacker.

This article explains how your backend can verify and decode Firebase ID tokens before acting on the users behalf.

metadaddy
  • 4,234
  • 1
  • 22
  • 46