Skip to content
pubscout

flutter_web_auth

0.6.0, released 2 years ago by an unverified publisher

Authenticate users with web services and OAuth2 via native web authentication sessions.

Unverified publisher
$ flutter pub add flutter_web_auth
Source repository

What it does

A Flutter plugin that opens a web browser view to authenticate users with third-party web services or OAuth2 providers and handles custom scheme redirects back to the app. It uses ASWebAuthenticationSession on iOS/macOS and Chrome Custom Tabs on Android.

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

Use it when

  • You need to implement OAuth2 authentication flows in your Flutter app.
  • You want to authenticate users using external web services via custom URL schemes.

Skip it when

  • You are looking for built-in Firebase Authentication flows.
  • You only want standard Google Sign-In helper packages without manual OAuth HTTP token exchanges.

Strengths

  • Uses native platform authentication sessions (ASWebAuthenticationSession and Chrome Custom Tabs)
  • Supports iOS, Android, macOS, and Web platforms
  • Works well with standard OAuth2 providers

Weaknesses

  • Requires manual configuration of intent filters on Android and custom HTML landing pages on Web
  • Known minor issues with keyboard accessibility or Chrome default browser bugs on macOS

Setup

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

Requires adding a custom CallbackActivity intent filter in AndroidManifest.xml and setting up a callback HTML file for web platforms.

import 'package:flutter_web_auth/flutter_web_auth.dart';

final result = await FlutterWebAuth.authenticate(
  url: "https://my-custom-app.com/connect",
  callbackUrlScheme: "my-custom-app",
);
final token = Uri.parse(result).queryParameters['token'];

Alternatives

Packages that do the same job and could replace flutter_web_auth.

  • google_sign_in

    If you specifically need a dedicated, out-of-the-box wrapper for Google Sign-In instead of a generic web auth flow.

  • firebase_auth

    If your backend is Firebase and you prefer using their integrated authentication suite.

  • sign_in_with_apple

    If you specifically need dedicated Sign in with Apple integration.