Android Question FireBaseStorage authentication without Oauth

Daniel-White

Active Member
Licensed User
Longtime User
Hi folks, one simple question.

Can I put in hard code a simple auth to allow to my app upload files to FireBaseStorage without need to use Oauth. the "B4A FirebaseAuth currently supports two authentication methods: Google and Facebook. There is no support for email / password authentication."

I know it is bad idea put the password etc in hard code, but I need something simple, I will not ask to end user the credentials etc, anyway the files will be uploaded anonymous to FireBaseStorage.

I can do this task with normal FTP server using FTPs etc, but I would like to use the feature of
" uploads and downloads regardless of network quality. Uploads and downloads are robust, meaning they restart where they stopped, saving your users time and bandwidth." <--- that is FireBaseStorage :eek:

Thanks... youuuuuuuuuuuu
 

Daniel-White

Active Member
Licensed User
Longtime User
I had been reading the https://www.b4x.com/android/forum/threads/firebasestorage-simple-file-storage-backend.68350/

"Note that you can use FirebaseStorage without FirebaseAuth and then use it to download files from the public folder." Can I upload too???? without FireBaseAuth?
Let me guess, I can modify this from https://www.b4x.com/android/forum/threads/firebasestorage-simple-file-storage-backend.68350/
B4X:
service firebase.storage {
  match /b/b4a-test1.appspot.com/o {
  match /auth/{allPaths=**} {
     allow read, write: if request.auth != null;
   }
  match /public/{allPaths=**} {
  allow read;
  }
  match /user/{userId}/{allPaths=**} {
  allow read, write: if request.auth.uid == userId;
  }

  }
}

And change
match /public/{allPaths=**} {
allow read;

By
match /public/{allPaths=**} {
allow read, write; <----------- add write. I will test and let you know here. :eek:
 
Upvote 0

Daniel-White

Active Member
Licensed User
Longtime User
We can close this thread, it is working great, my APP can upload and download files to public folder , yes, we can use FireBaseStorage without need any authentication. GREAT!! :D

The B4A Ver 6 and FireBaseStorage are amazing, I did some simple test, I turn off my Internet, pressed "Download Public" and wait one minute, later I turn on the wifi, and woala, the file starting to download, etc. finally, a very good tool. :rolleyes: , now I will migrate my stuff to firebase and forget to use FTPS :eek:

Erel, B4A Ver 6 and FireBase are very easy to put to work together. NICE ONEEEEEEEEEEEEEEEEEEEE , I am so happy like a dog with two tails!!!!! :D
 
Upvote 0
Top