optareid_flutter library
Optare ID Flutter SDK
Official Flutter SDK for Optare ID - a modern identity and access management platform.
Features
- OAuth 2.0 with PKCE authentication
- Secure token storage
- User profile management
- License verification
- Deep link handling
Getting Started
import 'package:optareid_flutter/optareid_flutter.dart';
void main() async {
await OptareAuth.init(
clientId: 'your-client-id',
redirectUri: 'myapp://callback',
);
runApp(MyApp());
}
Authentication
// Login
await OptareAuth.login();
// Check authentication status
final isAuthenticated = OptareAuth.isAuthenticated;
// Get current user
final user = await OptareAuth.getUser();
// Logout
await OptareAuth.logout();
Classes
- MemoryTokenStorage
- In-memory token storage for testing.
- OptareAuth
- Main entry point for Optare ID authentication.
- OptareConfig
- Configuration for Optare Auth SDK.
- OptareLicense
- License information for a product.
- OptareOrganization
- Organization model representing a company or team.
- OptareTokens
- Token container for OAuth tokens.
- OptareUser
- User model representing an authenticated Optare user.
- SecureTokenStorage
- Secure token storage using flutter_secure_storage.
- TokenStorage
- Abstract interface for token storage.
Enums
- LicenseStatus
- License status enum.
Exceptions / Errors
- OptareAuthException
- Exception thrown for authentication errors.
- OptareException
- Base exception for Optare SDK errors.
- OptareLicenseException
- Exception thrown for license/entitlement errors.
- OptareNetworkException
- Exception thrown for network errors.
- OptareNotInitializedException
- Exception thrown when the SDK is not initialized.