Skip to content
pubscout

oauth_webauth

5.2.0, released 11 months ago by dev.lamt.dev

WebView-based OAuth 2.0 flow for mobile and web

$ flutter pub add oauth_webauth
Source repository

What it does

Provides a widget that handles OAuth 2.0 authorization using an in-app WebView. It supports Android, iOS, macOS, Windows and Web, with optional locale, headers and user‑agent customization.

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

Use it when

  • You need full control over the authentication UI
  • You want to avoid system browser dialogs
  • You need to support web platform without native plugins

Skip it when

  • You prefer native authentication flows like AppAuth
  • Your app has very limited dependencies and you want the smallest footprint

Strengths

  • Full UI control inside the app
  • No system dialog or browser cache issues
  • Locale can be set via contentLocale
  • Supports custom headers and user‑agent

Weaknesses

  • Requires web_support.js for Web builds
  • Needs internet permission on Android and ATS settings on iOS
  • More setup than native plugins

Setup

Kind
Flutter widgets
Effort
Medium
Code generation
No
Direct dependencies
5

Add <uses-permission android:name="android.permission.INTERNET"/> to AndroidManifest, add NSAllowsArbitraryLoads to iOS Info.plist, include web_support.js in web/index.html head

```dart
OAuthWebView(
  configuration: OAuthConfiguration(
    clientId: 'your-client-id',
    redirectUrl: 'https://your.redirect',
    scopes: ['openid', 'profile'],
  ),
  onSuccessAuth: (token) => print('Token: $token'),
  onError: (e) => print('Error: $e'),
)
```

Alternatives

Packages that do the same job and could replace oauth_webauth.

Works with

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