Back

Sessions in python.

  • 0
  • Databases
  • Auth
uLuvBobs1337
7 Apr, 2024, 14:37

mmmm then how i suppose to authenticate if session is not supported in python lmao

TL;DR
Developers facing issues with setting up sessions in Python through Appwrite SDK. Error message indicates missing scope for the user. Solution involves ensuring correct API key setup and creating an email password session for user authentication. Sessions in Python are only supported from Appwrite 1.5 onwards, not in Appwrite 1.4. Consider user sign-ins from the frontend SDKs or using API keys for now.
uLuvBobs1337
7 Apr, 2024, 14:37

JWT ?

ideclon
7 Apr, 2024, 14:38

Yeah, so Cloud is still on Appwrite 1.4. Sessions in Python are only supported from Appwrite 1.5

ideclon
7 Apr, 2024, 14:39

Well, until SSR in 1.5, it was generally assumed that users would authenticate with one of the frontend SDKs, and then communicate directly with Appwrite from the browser.

uLuvBobs1337
7 Apr, 2024, 14:39

Thats perfectly fine

uLuvBobs1337
7 Apr, 2024, 14:40

mmmmmm i see that the only way is to make the user login from the front end and then to validate if he logged in from my python app.

ideclon
7 Apr, 2024, 14:43

Yes - or you could interact with the client side APIs directly from Python (not using the SDK), but I wouldn’t recommend that.

uLuvBobs1337
7 Apr, 2024, 14:44

mmmm i see what you say. well anyway thanks for the help!!!!

uLuvBobs1337
7 Apr, 2024, 14:44

oh and another thing

uLuvBobs1337
7 Apr, 2024, 14:45

nvm its changed my whole percpective on the architecture

uLuvBobs1337
7 Apr, 2024, 14:45

because the collections are restricted per user

uLuvBobs1337
7 Apr, 2024, 14:45

so if icannot set a session then that mean i cannot read them from my python client

uLuvBobs1337
7 Apr, 2024, 14:46

geeez 😦

uLuvBobs1337
7 Apr, 2024, 14:46

i think the solution is to create "email password" session and then cloud fucntion that will allow to read from the db session based

uLuvBobs1337
7 Apr, 2024, 14:46

!!!!!!!

ideclon
7 Apr, 2024, 14:47

You can read them with an API key

uLuvBobs1337
7 Apr, 2024, 14:47

yeah but they are restricted

uLuvBobs1337
7 Apr, 2024, 14:48

this is the api key that i use for the testing

ideclon
7 Apr, 2024, 14:48

API keys aren’t restricted by Permissions. Only by scopes

uLuvBobs1337
7 Apr, 2024, 14:48

27 scopes

ideclon
7 Apr, 2024, 14:49

If your API key has the database.read permission, it can read any Document in any Collection in any Database within your Project.

uLuvBobs1337
7 Apr, 2024, 14:54

idk man it doesnt working to me.

uLuvBobs1337
7 Apr, 2024, 14:55

now i found out that i didnt setup the key. And when i setup it i cannot create a email_password session

uLuvBobs1337
7 Apr, 2024, 14:56

1020 if http_error_msg: -> 1021 raise HTTPError(http_error_msg, response=self)

HTTPError: 401 Client Error: Unauthorized for url: https://cloud.appwrite.io/v1/account/sessions/email

During handling of the above exception, another exception occurred:

uLuvBobs1337
7 Apr, 2024, 14:56

AppwriteException: app.**********@service.cloud.appwrite.io (role: applications) missing scope (public)

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