Richardson
Richardson

Reputation: 2285

how to block access for non-authorized users to get pictures link from firestore storage?

I have an image link that I want to protect for only authorize users but the issue whenever I try to get the link I can see the picture, even if I specify the rule for it ?

rules_version = '2';

service firebase.storage {
  match /b/{bucket}/o {
    match /profiles/{userId}/{image} {
      // Read from storage !!
      allow get : if request.auth != null  // Authorized users only
    }
  }
}

Upvotes: 1

Views: 115

Answers (1)

Doug Stevenson
Doug Stevenson

Reputation: 317497

If you're referring to download URLs, those are not at all controlled by security rules or any form of authentication. Anyone who has the link can view the content. That behavior can't be changed.

Upvotes: 2

Related Questions