Access url without token in Firebase Storage

前端 未结 3 1987
闹比i
闹比i 2020-12-09 13:27

I have a firebase storage download url, like

https://firebasestorage.googleapis.com/v0/b/siren-5eee7.appspot.com/o/profile%2FC6jNlR0F4cZBPv7wF0REWUNVor33?alt=media&

3条回答
  •  轮回少年
    2020-12-09 13:50

    In case you need the rule to allow accessing only the images without a token you have to do the following:

    service firebase.storage {
      match /b/{bucket}/o {
        match /{allPaths=**} {
          allow read: if request.auth!=null || resource.contentType.matches('image/.*');
          allow write: if request.auth!=null;
        }
      }
    }
    
    

提交回复
热议问题