StorageException: StorageException has occurred. User does not have permission to access this object.

22,963 views
Skip to first unread message

ligaye robert

unread,
May 24, 2016, 10:29:42 AM5/24/16
to Firebase Google Group
E/StorageUtil: error getting token java.util.concurrent.ExecutionException: com.google.firebase.FirebaseException: An internal error has occured. [ Internal error. ]
05-24 08:55:54.208 2401-11238/com.radiochatroom.rcr.inc E/StorageException: StorageException has occurred.
                                                                            User does not have permission to access this object.
                                                                             Code: -13021 HttpResult: 403

 E/StorageException: The server has terminated the upload session
                                                                            java.io.IOException: The server has terminated the upload session
                                                                                at com.google.firebase.storage.UploadTask.zzVi(Unknown Source)
                                                                                at com.google.firebase.storage.UploadTask.zzVh(Unknown Source)
                                                                                at com.google.firebase.storage.UploadTask.run(Unknown Source)
                                                                                at com.google.firebase.storage.StorageTask$5.run(Unknown Source)
                                                                                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
                                                                                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
                                                                                at java.lang.Thread.run(Thread.java:818)

Benjamin Wulfe

unread,
May 24, 2016, 12:45:59 PM5/24/16
to Firebase Google Group
Hi ligaye -- the default security rules for storage buckets require you to sign in with firebase authentication.  You can use any authentication method.  At a minimum, you must you anonymous signin by:

* enable anonymous signin in the "Auth" tab of the Firebase website

You can also set your rules to allow access to anyone -- including those who have not yet authenticated.  But this is not recommended as your data will not be secure.

Evans Attafuah

unread,
May 24, 2016, 7:20:17 PM5/24/16
to Firebase Google Group
Can I use custom token just like it's done using the real time database?

Regards,
Evans. 

Jacob Wenger

unread,
May 24, 2016, 7:33:56 PM5/24/16
to fireba...@googlegroups.com
Yes, you can! You will just need to use request.auth in your rules instead of just auth.

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/507c32d1-3783-459a-b7eb-ebd40b09e0af%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

GmailMe

unread,
May 24, 2016, 7:38:42 PM5/24/16
to fireba...@googlegroups.com
Thanks

Sent from my iPhone 6
You received this message because you are subscribed to a topic in the Google Groups "Firebase Google Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/firebase-talk/X37PwJs6I0A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to firebase-tal...@googlegroups.com.

To post to this group, send email to fireba...@googlegroups.com.

Mike Mcdonald

unread,
May 25, 2016, 2:10:57 AM5/25/16
to Firebase Google Group
We've got a great section on using user authentication in the docs: https://firebase.google.com/docs/storage/security/user-security

Thanks,
--Mike

GmailMe

unread,
May 25, 2016, 2:19:25 AM5/25/16
to fireba...@googlegroups.com
Hello Mike, thanks for this info.

Regards.


Sent from my iPhone 6

Martín De Girolamo

unread,
May 26, 2016, 10:29:54 AM5/26/16
to Firebase Google Group
I'm using a custom token but this loose the connection every 30 or 45 minutes, so what's the point here? I don't know why every some time Auth is null and disconnect from database. I need something the keep alive for long time, not ask to my server every 1 hour to generate a new token for the user..... If I want to do something with database still fail all the time. Is it a problem you are trying to solve right now? Before this update I used to use anonymous login and keep alive all the time, put 10 years of connection and so on... now if Auth is null I cannot do nothing to database. Please I need some answer and help on it.....
Regards,

yOshi

unread,
May 29, 2016, 11:02:11 AM5/29/16
to Firebase Google Group
Change the rules permits Firebase Storage

Before: Default value
service firebase.storage {
    match /{allPaths=**} {
      allow read, write: if request.auth != null;
    }
  }
}
After: deleted ": if request.auth != null"
service firebase.storage {
    match /{allPaths=**} {
      allow read, write;
    }
  }
}
I hope to be helpful...bye


Hammad Nasir

unread,
Jun 10, 2016, 10:33:21 AM6/10/16
to Firebase Google Group
Hey Benjamin, I am using google authentication method and authenticating users with it. still I am getting this error:
E/StorageException: StorageException has occurred.
                                                                                 
User does not have permission to access this object.
                                                                                  Code: -13021 HttpResult: 403

Please help with this!


Frank van Puffelen

unread,
Jun 11, 2016, 11:17:17 AM6/11/16
to Firebase Google Group
Please don't hijack an existing thread for a (only marginally related) problem. Open a new thread and post the minimum information needed to troubleshoot the issue. For example: the code that shows how you authenticate and access the file, and the security rules that are in effect.

    puf

Kevin Moore

unread,
Jun 21, 2016, 8:45:47 PM6/21/16
to Firebase Google Group
Franklyn, be courteous don't be a bully, this is NOT your personal forum. The question is relevant to this thread. Instead of spending all the effort to criticize .. how about trying to provide
assistance?

Prudence Oatlhotse

unread,
Aug 15, 2016, 9:10:17 PM8/15/16
to Firebase Google Group
hi have you been able to find a solution i only just encountered this today

Mike Mcdonald

unread,
Aug 17, 2016, 12:37:56 PM8/17/16
to Firebase Google Group
The default rules require a user to be authenticated. Either enable Firebase Authentication, or remove this requirement in your security rules.

Thanks,
--Mike

KEVIN koech

unread,
Nov 15, 2017, 10:29:32 AM11/15/17
to Firebase Google Group
 If you do not want users to be authenticated, then delete the database "auth;null"  and replace with true ...do not  use "true"  just only true,    and storage do as yOshi posted..


MAIN thing......even after doing the above steps you get the error ....so

go to gradle   where there are compilation services u added and remove...."compile:....auth..."  making sure you disable all authentication in firebase and assuming you are using advanced android studio with built in firebase assitant on tools tab...
Reply all
Reply to author
Forward
0 new messages