I am using GoLang along as Google App Engine for hosting my web services.
I have been succesful in creating a file to my Firebase storage bucket, but then I would like to get a clean url for it that can be retrieved by clients (iOS / Android) that are authentified with firebase Auth.
What would be the easiest way to get such a link ?
What I have tried :
Getting ObjAttrs object, the bucket object attributes after the creation of the file : This way in Go
attrs, err := obj.Attrs(ctx)
and I do get the attributes, among them a value called MediaLink
A sample of this link would be "https://www.googleapis.com/download/storage/v1/b/MY_BUCKET/o/MY_FOLDER%2FMY_FILE_NAME?generation=1539262480095558&alt=media"
Problems :
If I try to open this link into a browser, I get the following error : "Anonymous caller does not have storage.objects.get access to...."
Fair enough, since I'm not authentified with Firebase Auth at this point
But I also tried from a iOS client which is properly authentified with Firebase Auth, and still the retrieval of the link failed.
On the web console, attached to my file in my bucket, I see a link such as this "https://firebasestorage.googleapis.com/v0/b/MY_BUCKET/o/MY_FOLDER%2FMY_FILENAME?alt=media&token=47630584-f05c-43a2-a04d-8fc21d207181"
This works on both browser and iOS clients.
Now is how can I get by code, in GOLang such URL ?
I have seen no documentation about this.