Skip to content
Back

Help with Appwrite Python SDK: Unable to send OTP to user.

  • 0
  • Self Hosted
  • Auth
  • Web
  • Cloud
Big Visio ✯ 𓃵
15 Jan, 2025, 18:50

Hi everyone! 👋 I’m a junior developer working on a login flow using Appwrite’s Python SDK with FastAPI.

After successfully creating a user session, I tried sending the user an MFA challenge using the create_mfa_challenge route but I’m greeted with this error:

{"detail": "Invalid credentials: app.66def3e30023dc74cc00@service.cloud.appwrite.io (role: applications) missing scope (account)"}

I can confirm my API key has been granted access to all the scopes.

I also attempted to initialize a new account instance using client.set_jwt with the session["secret"] as JWT. However, when I try calling methods I run into the following error:

{"detail": "Invalid credentials: Failed to verify JWT. Invalid token: Incomplete segments"}

I suspect I may have set something up incorrectly or misunderstood how session handling works in Appwrite. I’d appreciate it if someone could point me in the right direction. Please bear with me if I’ve made any rookie mistakes—still learning! 😊

TL;DR
Issue: Unable to send OTP to user using Appwrite Python SDK due to credential errors. Solution: The error seems to be related to incorrect JWT handling or incomplete segments within the JWT. Double-check the JWT initialization and ensure it is properly set up. Pay attention to the scope (account) permissions as well. Consider reviewing your setup and ensure that the JWT is correctly generated and utilized within the session handling process.
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