Error accessing Firebase Storage in Android Studio App

Asked

Viewed 144 times

0

I have a problem trying to set an image of Storage on ImageView from Android Studio, this error appears in logcat:

User does not have permission to access this Object. Code: -13021 Httpresult: 403 ľ "error": ' "code": 403, "message": "Permission denied. Could not perform this Operation" }} java.io.Ioexception: ? "error": ? "code": 403, "message": "Permission denied. Could not perform this Operation" }}

The rules are set for everyone:

service firebase.storage {
  match /b/{bucket}/o {
    match /{allPaths=**} {
      allow read, write: if request.auth == null;
    }
  }
}

2 answers

0

Take a look at the rules, you can define whether the user must be logged in to access:

inserir a descrição da imagem aqui

or configure public access:

// Anyone can read or write to the bucket, even non-users of your app.
// Because it is shared with Google App Engine, this will also make
// files uploaded via GAE public.
service firebase.storage {
  match /b/{bucket}/o {
    match /{allPaths=**} {
      allow read, write;
    }
  }
}
  • 0 vote against Accept I left the rule out for all service firebase.Storage { match /b/{Bucket}/o { match /{allPaths=**} { allow, write: if request.auth == null; } } }

  • Try it this way: 
service firebase.storage {
 match /b/{bucket}/o {
 match /{allPaths=**} {
 allow read, write;
 }
 }
}

  • It worked out, thank you very much

0

I left the rule clear for everyone firebase service.Storage { match /b/{Bucket}/o { match /{allPaths=**} { allow read, write: if request.auth == null; } } }

Browser other questions tagged

You are not signed in. Login or sign up in order to post.