Back

Issues with Dynamic Service Instances

  • 0
  • Tools
  • Auth
  • General
  • Functions
sygoot
10 Nov, 2024, 19:14

Hi everyone,

I’m developing a .NET client app using Appwrite and encountered issues with dynamic service instances. Specifically:

Dynamic Service Problem:

Logging in a user with one service instance and performing a subsequent operation (e.g., updating the user name) with a new instance fails. Keeping a single service instance for both operations works fine. Postman Behavior:

Requests fail in Postman due to missing scopes, but work in my app using AppWriteService. This suggests the Client stores something (e.g., session info) that enables these operations. Questions What exactly does Client retain after login that allows subsequent requests? How should I handle authentication flow in Appwrite? What’s returned by CreateEmailPasswordSession (session, token, or both)? When should I use JWT vs session-based authentication? Is it recommended to use a single service instance for all operations, or is there a way to make dynamic instances work? Thanks in advance!

TL;DR
Developers having issues with dynamic service instances in .NET client app using Appwrite. Single service instance works but multiple instances fail. Postman requests fail due to missing scopes. Questions include how client stores information after login, handling authentication flow, output of CreateEmailPasswordSession, when to use JWT vs session-based authentication, and whether to use single or dynamic service instances. Solution: Stick to using a single service instance for all operations.
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