
Hi All. I just started using AppWrite with Android (kotlin
) and I am having some issues getting the JWT token to allow my user to pull down image from Storage with read
permissions. I know the token is valid and not-expired because I checked the JWT expiration date and the token is also for my logged in user. I will show you the steps I have taken below:
I am logging in the user and getting a token:
val session = account.createEmailPasswordSession(email, password)
val token = account.createJWT()
...
Just to isolate Android from my AppWrite setup, I pulled the token out and plugged it into Postman to query my AppWrite Storage endpoint:
This is the message i get with that:
{
"message": "The current user is not authorized to perform the requested action.",
"code": 401,
"type": "user_unauthorized",
"version": "1.8.0"
}
I have given my user (the same one I have the token for) read
permissions on my AppWrite Storage.
If I give my Storage Any
with read
permission, I am able to access the image in storage just fine. So it seems to be blocking based on my invalid token or my request url (I am just copying the file url from the Storage area in AppWrite to get the url).
Any help would be greatly appreciated!
Thanks!
Recommended threads
- HELP!! Can't Integrate Appwrite Function...
SO, I am new to Appwrite and I am not able to understand how to connect Appwrite Functions to my next js project. I have tried asking Gemini but it doesn't seem...
- general_argument_invalid, Param "email" ...
[ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: AppwriteException: general_argument_invalid, Param "email" is not optional. (400) E/flut...
- createPhoneToken() new method email requ...
**Hello beautiful people!** It’s been a while — I retired at 27, but now I’m back! 😊 I’m running into an issue with Appwrite in Flutter. I used an older versi...
