Skip to content

Sign in with OAuth2 on Windows and Linux through a loopback token callback in the Flutter SDK #2094

Closed

Description

@ChiragAgg5k

Tracks PR #2093.

Plan

Goal: Make OAuth2 sign-in work in the generated Flutter SDK on Windows and Linux, where flutter_web_auth_2 only accepts an http://localhost:{port} callback and createOAuth2Session never returns key/secret to a custom success URL.

What changes:

  • templates/flutter/lib/src/client_io.dart.twig: on Windows and Linux, webAuth uses the given success URL (or a free loopback port, http://localhost:<port>/) as the callback, sets success and (unless given) failure to it, and for createOAuth2Session opens /account/tokens/oauth2/{provider} and exchanges the returned userId/secret via POST /account/sessions/token. Android, iOS and macOS keep the appwrite-callback-<projectId> flow; saving that session now waits for an in-flight init() and awaits the cookie write.
  • templates/flutter/test/src/client_io_test.dart.twig (new) and src/SDK/Language/Flutter.php: generate a test covering loopback sign-in, given success/failure URLs and error callbacks on Linux and Windows, plus the Android callback flow.

Remaining steps: None beyond the linked PR. Projects still need a Web platform for localhost so the server accepts the loopback success URL, which is worth mentioning in Flutter SDK docs.

Done when:

Activity

  1. self-assigned this
    on Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions