Back

storage.getFileDownload() not working on IOS.

  • 0
  • Web
Allen
22 Dec, 2023, 06:14

I have set the user read only permission for my bucket. It is working on mac and android for my vue app. However, it doesn't work on IOS. I got an 401 error saying the current user is not authorized to perform the requested action. Not really sure how to solve this issue.

TL;DR
Summary: The `storage.getFileDownload()` function is not working on iOS, but works on Mac and Android. Users are receiving a 401 error stating they are not authorized to perform the requested action. The issue may be related to third-party cookie settings or a custom domain configuration. Solution: Check third-party cookie settings, ensure proper permissions are set, and review any custom domain configurations.
D5
23 Dec, 2023, 21:16

This is a website?

D5
23 Dec, 2023, 21:18

Are you using cloud or self-hosted?

Allen
24 Dec, 2023, 01:26

I am using appwrite cloud.

D5
24 Dec, 2023, 16:51

Are you sure permissions are set correctly?

Allen
25 Dec, 2023, 16:30

I believe so. Because I have set user read only permission for the bucket. On Mac and android when visit my app after they are authenticated using createEmailSession(), users are able to download the file from the bucket. However, when users access my app from IOS device, it shows users are not authorized to download. It looks like the sdk does not grab the session data from the client, because when I add bucket policy with guest access, users are able to download the file then

ideclon
25 Dec, 2023, 17:31

I assume you are also creating a session with createEmailSession() in iOS?

ideclon
25 Dec, 2023, 17:32

And is this a website? Or an app?

Allen
26 Dec, 2023, 05:54

It is an web application using Nuxt 3 as the frontend. And yes, I am using createEmailSession() in IOS.

ideclon
26 Dec, 2023, 06:39

So this is the same codebase between iOS and Android/Desktop?

Allen
27 Dec, 2023, 19:31

Yes, it is same. That's why I found it really real wired.

Drake
27 Dec, 2023, 19:52

probably a 3rd party cookie problem. do you have a custom domain configured?

Allen
27 Dec, 2023, 20:04

I don't think so. My web app is deployed on render.com. And I did not add any custom domain name.

D5
27 Dec, 2023, 23:13

Then you will need to be sure third party cookies are allowed in your browser

Drake
27 Dec, 2023, 23:41
Allen
28 Dec, 2023, 16:00

Thank you @Steven @D5. I think that might be the cause. I will give it try.

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