implementing-flutter-social-auth ยท git:20260331.fee8ef2 ยท 2026-03-31 ยท sha256 b56f77ed68017ad5

implementing-flutter-social-auth git:20260331.fee8ef2A

Immutable. This exact content never changes and is served at /api/v1/blob/b56f77ed68017ad5.

No tool to install first
claude plugin marketplace add https://markdownregistry.com/mp/a/art_asdoh3fnm56qro5k/b56f77ed68017ad5d5aae0e73122c8f56755565b2e4f2d9558d2f63551e90f27.json

Then /plugin install implementing-flutter-social-auth@markdownregistry-asdoh3fnm56qro5k in Claude Code. It installs this exact version, the one graded A here, pinned to the commit it was graded at, and leaves it there.

---
name: "flutter-social-auth"
description: "Social authentication integration for Flutter with Google, Apple, Facebook, and LINE sign-in. Use when implementing OAuth login flows, configuring native platform credentials, or troubleshooting sign-in failures."
metadata:
  last_modified: "2026-03-12 11:18:17 (GMT+8)"
---

# Flutter Social Authentication Guide

## Goal
Implement secure, high-quality social authentication in Flutter applications across iOS, Android, and Web. This skill focuses on the most common identity providers (Google, Facebook, Apple) using best-practice plugins and native configuration strategies to ensure a seamless "Privacy-First" user experience.

## Process

### Phase 1: Provider Selection & Requirements
Identify the required social providers and gather necessary developer portal credentials.
- **Google**: Google Cloud Console / Firebase Console (SHA-1 fingerprint required for Android).
- **Facebook**: Meta for Developers (App ID, Client Token).
- **Apple**: Apple Developer Program (Service ID, Team ID, Key ID).
- **LINE**: LINE Developers Console (Channel ID).

### Phase 2: Platform-Specific Configuration
Each provider requires specific configurations in `AndroidManifest.xml`, `Info.plist`, or `web/index.html`.
- [Google Sign-In Setup](./references/google-sign-in.md)
- [Facebook Login Setup](./references/facebook-login.md)
- [Apple Sign-In Setup](./references/apple-sign-in.md)
- [LINE Login Setup](./references/line-login.md)

### Phase 3: Implementation & State Management
Integrate the authentication flow with the app's state management (e.g., Riverpod 3.0 Notifiers).
1. **Initialize**: Call the respective plugin `init` or configuration methods.
2. **Authenticate**: Trigger the login flow and capture the `AccessToken` or `IdToken`.
3. **Handle Persistence**: Store credentials securely using `flutter_secure_storage`.
4. **Error Handling**: Implement retry logic and display user-friendly error messages (e.g., ApiException 10 for Google).

---

## ๐Ÿ“š Documentation Library
Refer to these specialized resources for each identity provider:

- [๐ŸŽฏ Google Sign-In Best Practices](./references/google-sign-in.md)
- [๐Ÿ‘ค Facebook Login Best Practices](./references/facebook-login.md)
- [๐ŸŽ Apple Sign-In Best Practices](./references/apple-sign-in.md)
- [๐Ÿ’ฌ LINE Login Best Practices](./references/line-login.md)

## Constraints
* **Native Overlays**: Always call `WidgetsFlutterBinding.ensureInitialized()` before initializing auth plugins in `main()`.
* **Security Awareness**: NEVER store raw AccessTokens in `SharedPreferences`. Use `Secure Storage` (encrypted).
* **Privacy Compliance**: Ensure Apple Sign-In is implemented if any other 3rd party social login is offered on iOS.
* **Error Resilience**: Always handle the `cancel` state gracefully when a user closes the auth popup.
* **Metadata**: All reference documents must include standardized metadata with `last_modified` timestamp.