Back

Storage Permission Problem in appwrite cloud.

  • 0
  • Android
  • Storage
Shubham
16 Aug, 2023, 19:00

when i give user read permission , its not showing , but when i give any permission , it is showing , but i am logged in right now . How will i fix this problem.

TL;DR
User is facing a problem with generating JWT in the Appwrite Android app and is concerned about the security of the token. The user also mentions that accessing a file works without authentication. Solution provided is to generate a JWT token and pass it in the headers using Glide. User is advised to check if headers can be passed using Glide and is provided with code example for displaying an image using Glide. User asks for clarification on how to access the file and mentions that when giving user read permission, it is not showing up. No solution is provided for this specific problem.
Drake
16 Aug, 2023, 19:03

how are you trying to access the file?

Shubham
16 Aug, 2023, 19:20

in android i am using glide to show image

Drake
16 Aug, 2023, 19:20

how exactly? code please?

Shubham
16 Aug, 2023, 19:24

val url="${apiConstants.ENDPOINT}/storage/buckets/${apiConstants.BUCKET_ID}/files/${data.img_id}/view?project=${apiConstants.PROJECT_ID}" Glide.with(viewHolder.itemView.context) .load(url) // image url //.placeholder(R.drawable.load2) // any placeholder to load at start .error(R.drawable.user4) // any image in case of error .centerCrop() // resizing .into(banImgg)

Shubham
16 Aug, 2023, 19:25

img_id comes from database

Drake
16 Aug, 2023, 19:27

please make sure to wrap multi line code with 3 backticks

Drake
16 Aug, 2023, 19:28

so this accesses a file without any authentication. that's why it works with the any permission.

Drake
16 Aug, 2023, 19:29

are you able to pass headers using Glide?

Shubham
16 Aug, 2023, 19:42

but it was working fine in self hosting appwrite

Drake
16 Aug, 2023, 19:43

maybe your permissions were different when self hosting

Shubham
16 Aug, 2023, 19:44

no same permission

Shubham
16 Aug, 2023, 19:44

so for users only permission , i have to generate jwt , right?

Shubham
17 Aug, 2023, 07:10

but any body can steal this jwt and view my content for free

darShan
17 Aug, 2023, 07:16

from the docs: The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame.

Shubham
17 Aug, 2023, 07:37

how will i generate JWT in client android app in appwrite?

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