oauth_webauth
5.2.0, released 11 months ago by dev.lamt.dev
WebView-based OAuth 2.0 flow for mobile and web
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.
- google_sign_in
Provides native Google sign‑in with minimal setup
84Compare - firebase_auth
Offers comprehensive auth with multiple providers and backend integration
99Compare - flutter_web_auth_2
Simpler web‑only OAuth flow without WebView
93Compare
Works with
Packages commonly used together with oauth_webauth: ones it builds on, ones built on it, and its own family.
- weboauth_webauth depends on itLightweight bindings for browser APIs via JS interop
- shared_preferencesoauth_webauth depends on itFlutter plugin for reading and writing simple key-value pairs. Wraps NSUserDefaults on iOS and SharedPreferences on Android.
- flutter_inappwebviewoauth_webauth depends on itAdd inline WebViews, headless WebViews, and in-app browser windows.
- oauth2oauth_webauth depends on itA client library for OAuth2 authentication and authorized HTTP requests.
- flutter_onedriveBuilt on oauth_webauthUpload, download, and manage files on Microsoft OneDrive from a Flutter app.