getDownloadURL() 401, also in firebase console

958 views
Skip to first unread message

Daniel Zuidinga

unread,
Mar 30, 2017, 3:33:45 PM3/30/17
to Firebase Google Group

I upload a file via python API to my firebase/google storage. I make it also public:

 with open(localfilename, 'rb') as localfile:
        dst_uri = boto.storage_uri(DOGS_BUCKET + '/' + storagefilename, GOOGLE_STORAGE)
        dst_uri.new_key().set_contents_from_file(localfile)
        dst_uri.new_key().make_public()  


But when generating a download url in Javascript I get an 401 error. I also can't generate a download link in the firebase console.

  var starsRef = firebase.storage().ref().child(fullPath);

  starsRef.getDownloadURL().then(function (url) {
            console.log('downloadUrl: ' + url);
            window.location.assign(url);
        }).catch((error: any) => {
            // 401 error
  }

Jacob Wenger

unread,
Mar 30, 2017, 3:45:35 PM3/30/17
to fireba...@googlegroups.com
Your Firebase Security Rules for Cloud Storage are probably preventing access. Make sure you read up on that section of the docs and check the rules in your console.

Cheers,
Jacob

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/ab27362e-9fd5-40b5-8524-22a47da15ea8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Daniel Zuidinga

unread,
Mar 30, 2017, 3:52:45 PM3/30/17
to Firebase Google Group
Can't be? I have standard rules_service firebase.storage {
  match /b/{bucket}/o {
    match
/{allPaths=**} {
      allow read
, write: if request.auth != null;
   
}
 
}
}
So logged in users should get all files? Also I can't download some files from firebase console administration. I just get an error.

Jacob Wenger

unread,
Mar 30, 2017, 3:58:18 PM3/30/17
to fireba...@googlegroups.com
Thanks for all those additional details. Looks like something must be wrong with your Storage bucket. Would you mind starting a support thread here so that we can know what project you have?

Jacob

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.

Daniel Zuidinga

unread,
Mar 30, 2017, 4:13:24 PM3/30/17
to Firebase Google Group
I did a support request. Thanks


Am Donnerstag, 30. März 2017 21:58:18 UTC+2 schrieb Jacob Wenger:
Thanks for all those additional details. Looks like something must be wrong with your Storage bucket. Would you mind starting a support thread here so that we can know what project you have?

Jacob
On Thu, Mar 30, 2017 at 12:52 PM, 'Daniel Zuidinga' via Firebase Google Group <fireba...@googlegroups.com> wrote:
Can't be? I have standard rules_service firebase.storage {
  match /b/{bucket}/o {
    match
/{allPaths=**} {
      allow read
, write: if request.auth != null;
   
}
 
}
}
So logged in users should get all files? Also I can't download some files from firebase console administration. I just get an error.

Am Donnerstag, 30. März 2017 21:45:35 UTC+2 schrieb Jacob Wenger:
Your Firebase Security Rules for Cloud Storage are probably preventing access. Make sure you read up on that section of the docs and check the rules in your console.

Cheers,
Jacob

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.

To post to this group, send email to fireba...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages