https://github.com/flutter-news-app-full-source-code/auth-api
A concrete API implementation of the `AuthClient` interface for the Flutter News App Toolkit.
https://github.com/flutter-news-app-full-source-code/auth-api
Last synced: 4 months ago
JSON representation
A concrete API implementation of the `AuthClient` interface for the Flutter News App Toolkit.
- Host: GitHub
- URL: https://github.com/flutter-news-app-full-source-code/auth-api
- Owner: flutter-news-app-full-source-code
- License: other
- Created: 2025-05-03T09:23:05.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2026-01-12T08:03:04.000Z (5 months ago)
- Last Synced: 2026-02-08T08:55:27.657Z (4 months ago)
- Language: Dart
- Homepage:
- Size: 71.3 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
Auth API
A concrete API implementation of the `AuthClient` interface for the Flutter News App Toolkit.
This `auth_api` package provides a concrete API implementation of the `AuthClient` interface (defined in `package:auth_client`) within the [**Flutter News App Full Source Code Toolkit**](https://github.com/flutter-news-app-full-source-code). It encapsulates the logic for interacting with a backend authentication service via HTTP requests, leveraging `package:http_client` for underlying communication and standardized error handling. This package is crucial for applications that need to connect to a remote authentication service, ensuring consistent and robust authentication mechanisms across the Flutter mobile app, web dashboard, and Dart Frog backend API.
## ⭐ Feature Showcase: Robust Backend Authentication Integration
This package offers a comprehensive set of features for integrating with a backend authentication service.
🧱 Core Functionality
### 🚀 `AuthClient` Implementation
- **`AuthApi` Class:** A concrete implementation of the `AuthClient` interface, providing a standardized way to interact with a remote authentication service.
- **HTTP-Based Communication:** Utilizes `package:http_client` for making HTTP requests to the backend authentication service.
### 🔐 Authentication Flows
- **`requestSignInCode`:** Initiates the process of requesting a sign-in code via email.
- **`verifySignInCode`:** Verifies the sign-in code to complete the authentication process.
- **`signInAnonymously`:** Allows users to sign in anonymously, creating a temporary user identity on the backend.
- **`getCurrentUser`:** Retrieves the currently authenticated user's details from the backend.
- **`authStateChanges` Stream:** Provides a stream for monitoring real-time authentication state changes.
- **`signOut`:** Handles signing out the current user from the backend.
### 🛡️ Standardized Error Handling
- **`HttpException` Propagation:** Propagates standardized `HttpException` errors (from `core`) from the underlying `http_client`, ensuring consistent and predictable error management across the application layers.
### 💉 Dependency Injection Ready
- **`HttpClient` Dependency:** Requires a configured `HttpClient` instance (from `package:http_client`) via its constructor, promoting loose coupling and testability.
> **💡 Your Advantage:** This package provides a robust and production-ready API client for backend authentication. It simplifies the integration of remote authentication services, leverages standardized error handling, and ensures consistent authentication flows across your application ecosystem.
## 🔑 Licensing
This source code is licensed for commercial use and is provided for local evaluation. A **Lifetime Commercial License** is required for any production or public-facing application.
Please visit the main [Flutter News App Full Source Code Toolkit](https://github.com/flutter-news-app-full-source-code) organization page to review the full license terms and to purchase.