Skip to content
pubscout

flutter_appauth

13.0.0, released 3 weeks ago by dexterx.dev

Flutter plugin for OAuth 2.0 and OpenID Connect authentication using native AppAuth SDKs.

WASM-readyRock solid
$ flutter pub add flutter_appauth
Source repository

What it does

Provides an abstraction around the native Android, iOS, and macOS AppAuth SDKs to handle authentication and authorization flows, including PKCE extensions and token exchanges. It launches the system browser for user sign-in and handles redirects back to the application.

AI-written summary of version 13.0.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to authenticate users via OAuth 2.0 or OpenID Connect providers like Auth0, Azure B2C, or custom identity servers.
  • Your identity provider requires PKCE for native mobile application security.
  • You want to use native browser-based authentication flows on Android, iOS, and macOS.

Skip it when

  • You are looking for built-in backends or user management systems like Firebase or Supabase.
  • You want simple pre-built social sign-in buttons without dealing with custom OAuth schemes and discovery endpoints.

Strengths

  • Supports PKCE extension for secure native app authentication.
  • Works with standard OAuth 2.0 and OpenID Connect providers (Auth0, IdentityServer, Okta, etc.).
  • Provides built-in token refreshing and user cancellation handling.

Weaknesses

  • Requires manual native configuration for custom URL schemes on Android, iOS, and macOS.
  • Relies on launching external browser tabs, which might not fit all custom UI requirements.

Setup

Kind
Plugin (native code)
Effort
Medium
Code generation
No
Direct dependencies
1

Requires configuring custom redirect schemes in Android's build.gradle or AndroidManifest.xml and iOS/macOS Info.plist files.

FlutterAppAuth appAuth = FlutterAppAuth();
final AuthorizationTokenResponse result = await appAuth.authorizeAndExchangeCode(
  AuthorizationTokenRequest(
    '<client_id>',
    '<redirect_url>',
    discoveryUrl: '<discovery_url>',
    scopes: ['openid', 'profile', 'email', 'offline_access', 'api'],
  ),
);

Alternatives

Packages that do the same job and could replace flutter_appauth.

  • firebase_auth

    Choose this if your backend is Firebase and you want a fully managed authentication service.

  • google_sign_in

    Choose this if you specifically only need Google Sign-In rather than a generic OAuth/OIDC client.

Works with

Packages commonly used together with flutter_appauth: ones it builds on, ones built on it, and its own family.