문제 : auth가 없는 상태에서 firebase Storage read 시, 에러 

error FirebaseError: Firebase Storage: User does not have permission to access '*******'. (storage/unauthorized)

원인 : Firebase Storage 접근 권한 이슈

해결 : Firebase Storage Rules 수정

Firebase Console > Storage > Rules

수정 전 : read/write 모두 auth가 있는 경우에만 허용

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

 

수정 후 : read를 분리하여 허용, write는 기존 권한 유지

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

 

참고 : stackoverflow.com/questions/38671444/user-does-not-have-permission-to-access-this-object-firebase-storage-android

 

User does not have permission to access this object . Firebase storage android

I am new to firebase storage. Just so I could learn it, I made a simple app that has a button and an ImageView. When I click on the button, an image (from drawable) gets displayed on the ImageView. I

stackoverflow.com

 


잘하셨습니다, OHMH(애매)

2021.02.19.

 

 

 

 

'CCAAFFEE > Dev' 카테고리의 다른 글

Vue Global Alert Component 제작기(1) - Vuex store & Navigation  (0) 2021.02.20

+ Recent posts