Back

[SOLVED] Not authorized to access files in buckets

  • 0
  • Web
cheniki_21
20 Nov, 2023, 10:17

Hi, i'm facing an issue regarding appwrite file permission, i have a web app that allows the user to download a file from the appwrite strorage, for that purpose i set up an api key with the permission to read the files and buckets, when trying to download a file, this error pops up: {"message":"The current user is not authorized to perform the requested action.","code":401,"type":"user_unauthorized","version":"1.4.9"} btw, when i'm signed-in into the appwrite, it downloads the file properly, but if i'm signed out (which should be the case for all users) i won't download and the above message appears FYI: the appwrite is installed within our VPS server

TL;DR
User is facing an issue with appwrite file permission. They have set up an API key with read access to files and buckets. When trying to download a file, they get an "unauthorized" error. The error only occurs if the user is signed out. The appwrite is installed on their VPS server. Solution: API keys cannot be used with the front-end SDK. Grant access to anyone on the files so they don't require being logged in. This will allow users to download files even when signed out.
ideclon
20 Nov, 2023, 10:21

You can’t use an API key with the front-end SDK. You can grant access to anyone on the files, so that they don’t require being logged in

cheniki_21
20 Nov, 2023, 10:29

alright, thanks, it worked

Drake
20 Nov, 2023, 20:08

[SOLVED] Not authorized to access files in buckets

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more