パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v0.0.16

desktop_webview_auth

このパッケージは、WebView を介してデスクトップ上で Firebase OAuth を有効にします

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
5.4万
いいね数
54
Pub ポイント
120

パッケージをインストール

flutter pub add desktop_webview_auth

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Flutterパッケージで、WebViewを使用してデスクトッププラットフォーム(macOS、Windows、Linux)でのFirebase OAuth認証を可能にします。アプリ内にブラウザウィンドウを埋め込むことで、OAuthフローをスムーズに処理でき、ユーザーがFirebaseでログインしながらもセキュリティとユーザーエクスペリエンスを維持できます。ネイティブのOAuthサポートが限られているデスクトップ環境で認証が必要なアプリには特に有用です。このパッケージはFirebase Authと直接統合され、Android、iOS、Web、およびデスクトップオペレーティングシステムを含む複数のプラットフォームで動作します。

用途

  • Firebase を用いたデスクトップアプリ認証
  • クロスプラットフォームデスクトップアプリケーションにおけるOAuthフロー
  • macOS、Windows、Linux での WebView を通じたセキュアなログイン
  • デスクトップアプリケーションへのFirebase Authの統合
  • デスクトップ環境でのOAuthリダイレクトの処理

主な機能

  • デスクトッププラットフォームでのFirebase OAuthをサポート
  • 認証に埋め込みウェブビューを使用します
  • クロスプラットフォーム互換性
  • セキュアなトークン処理
  • Firebase Auth とのシンプルな統合
  • OAuthリダイレクトURLを自動的に処理します

適している対象

  • Firebase認証を使用してデスクトップアプリを構築する開発者
  • macOS、Windows、または Linux で OAuth を必要とするアプリ
  • デスクトップ上で安全でネイティブなログイン体験を必要とするプロジェクト
  • 一貫した認証を備えたマルチプラットフォーム展開をターゲットにするチーム
  • 信頼できるデスクトップOAuthソリューションを探しているFlutter開発者

注意事項

  • Firebase コンソールで適切な OAuth 設定が必要です
  • リダイレクト処理のためのカスタムURLスキームが必要になる場合があります
  • Firebase Auth 統合に限定
  • デスクトップOSによってWebviewの動作がわずかに異なる場合があります
  • モバイルのみの使用ケースには適していません

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

Desktop webview auth

Chat on Discord

This package enables Firebase OAuth on desktop platforms via webview

⚠️ Maintenance status: not actively maintained

This package was built to fill a gap: OAuth sign-in flows for Flutter desktop apps, at a time when the official Firebase solutions had no desktop support.

It still works, and for some use cases it remains the nicest desktop OAuth experience available — but it is not integrated with the wider FlutterFire ecosystem, and Invertase is no longer actively developing it. We will keep the repository public and accept the occasional community PR, but there is no guaranteed maintenance, no roadmap, and no support commitment. Issues may go unanswered.

It's kept public because it's still useful as-is, and because it's a solid starting point for anyone wanting to build a pure-Dart auth implementation. If you depend on it, please pin your version and be prepared to fork.

Supported providers:

  • Google
  • Facebook
  • Twitter

Installation

macOS setup

The recaptcha verification flow is done on the local server, and it requires that the app has the following in the Release.entitlements:

<key>com.apple.security.network.server</key>
<true/>
Linux setup

To display webview on Linux, WebKit2GTK development libraries are used, if you don't have it already installed:

Ubuntu:

apt install libwebkit2gtk-4.0-dev

Fedora:

dnf install webkit2gtk3-devel

Additionally, if Flutter is installed using snap, you might face issues compiling the app, to fix you would need to uninstall the snap version and install Flutter manually on Linux.

Windows setup

Make sure you are on latest stable channle of Flutter, and have installed the requirements as mentioned here.

Nothing extra is needed to get started on Windows.

Add dependency
flutter pub add desktop_webview_auth
Imports
import 'package:desktop_webview_auth/desktop_webview_auth.dart';
import 'package:desktop_webview_auth/google.dart';
import 'package:desktop_webview_auth/facebook.dart';
import 'package:desktop_webview_auth/twitter.dart';

Usage

  • Configure OAuth providers in firebase console
  • Create an instance of ProviderArgs
final googleSignInArgs = GoogleSignInArgs(
  clientId:
    '448618578101-sg12d2qin42cpr00f8b0gehs5s7inm0v.apps.googleusercontent.com',
  redirectUri:
    'https://react-native-firebase-testing.firebaseapp.com/__/auth/handler',
  scope: 'email',
)
  • call DesktopWebviewAuth.signIn
try {
    final result = await DesktopWebviewAuth.signIn(args);

    print(result?.accessToken);
    print(result?.tokenSecret);
} catch (err) {
    // something went wrong
}
  • create an instance of OAuthCredential and sign in
import 'package:firebase_auth/firebase_auth.dart';

final credential = GoogleAuthProvider.credential(accessToken: result.accessToken)

FirebaseAuth.instance.signInWithCredential(credential);

カテゴリー

依存関係

依存関係一覧 3 件

  • crypto^3.0.3
  • http^1.0.0
  • plugin_platform_interface^2.1.4

ソースリポジトリ

このパッケージを使用しているプロジェクト