Back

FlutterFlow with REST API - best practices?

  • 0
  • REST API
  • Cloud
mdmike.
9 Feb, 2024, 10:12

Hi there! I am integrating my appwrite cloud backend with FlutterFlow using REST. I can log in and use the X-Fallback-Cookies header with the session cookie to perform operations on the appwrite backend. However, looking at the docs, for the REST platform, all requests headers are authenticated with a JWT token - since these have a validity of just 15 minutes according to the docs, I would need to either stay with my current X-Fallback-Cookies implementation or retrieve new JWT tokens before every request. Even the JWT token retrieval is authenticated with the Fallback session cookie. I am afraid that with future updates the X-Fallback-Cookie method might stop working and I will get in trouble with my app. Any advice?

TL;DR
Title: Best practices for using FlutterFlow with REST API and JWT tokens Developer is integrating FlutterFlow with appwrite cloud backend using REST. Currently using X-Fallback-Cookies header with session cookie for authentication. Concerned about future updates and potential issues with X-Fallback-Cookie method. Possible Solution: Developer can continue using X-Fallback-Cookies for now, as cookies are unlikely to be deprecated soon. However, consider retrieving new JWT tokens before every request for better long-term compatibility. Keep an eye out for future updates that may introduce long-lived JWT tokens.
Ernest
9 Feb, 2024, 10:58

IMO your approach is fine for the time being. There's growing support for long-lived (custom expiry tume) JWTs which will probably be released in an update in the future. Basically, I don't think you have to worry about cookies being deprecated anytime soon. Take it with a grain of salt because I'm not on the core team

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