2

When I simple "took" a images on firebase console it create me automatically a download url like https://firebasestorage.googleapis.com/XXX/YYY/XXX/name.jpg?alt=media&token=.

I wanna have my file super-secured, how I can remove this download url or revoke this token?

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Stefano
  • 390
  • 3
  • 10

3 Answers3

2

The Firebase console provides a "revoke" option next to the download URL which can be used for this (look under the "File Location" tab). You should use Firebase rules to properly secure your assets, if object-level security is important to you: https://firebase.google.com/docs/storage/security/

Hiranya Jayathilaka
  • 7,180
  • 1
  • 23
  • 34
2

There's no way you can restrict that url (not even through security rules). It is always public but note that it is unguessable. There is also a revoke option through Firebase console just in case the URL leaks.

goblin
  • 1,513
  • 13
  • 13
  • Conceptually, you should consider having the token the same as having the image, and so you should look into protecting access to the image itself. There's more info [here](https://stackoverflow.com/questions/41088164/enforce-authentication-for-firebase-storage-downloadable-urls). – katfang Feb 09 '18 at 22:25
  • My question is how I can revoke token through flutter code – Noobdeveloper Jul 22 '21 at 20:32
0

As pointed by others you don't need to be concerned about this URL as in practice is very hard to guess. However you should not share it or use it as entry point to the application. Instead you should use the Signed URLs support provided by Google Cloud.