Files
unionflow-server-impl-quarkus/unionflow-mobile-apps/lib/core/constants/app_constants.dart
DahoudG f89f6167cc feat(mobile): Implement Keycloak WebView authentication with HTTP callback
- Replace flutter_appauth with custom WebView implementation to resolve deep link issues
- Add KeycloakWebViewAuthService with integrated WebView for seamless authentication
- Configure Android manifest for HTTP cleartext traffic support
- Add network security config for development environment (192.168.1.11)
- Update Keycloak client to use HTTP callback endpoint (http://192.168.1.11:8080/auth/callback)
- Remove obsolete keycloak_auth_service.dart and temporary scripts
- Clean up dependencies and regenerate injection configuration
- Tested successfully on multiple Android devices (Xiaomi 2201116TG, SM A725F)

BREAKING CHANGE: Authentication flow now uses WebView instead of external browser
- Users will see Keycloak login page within the app instead of browser redirect
- Resolves ERR_CLEARTEXT_NOT_PERMITTED and deep link state management issues
- Maintains full OIDC compliance with PKCE flow and secure token storage

Technical improvements:
- WebView with custom navigation delegate for callback handling
- Automatic token extraction and user info parsing from JWT
- Proper error handling and user feedback
- Consistent authentication state management across app lifecycle
2025-09-15 01:44:16 +00:00

74 lines
2.8 KiB
Dart

class AppConstants {
// API Configuration
static const String baseUrl = 'http://192.168.1.11:8080'; // Backend UnionFlow
static const String apiVersion = '/api';
// Timeout
static const Duration connectTimeout = Duration(seconds: 30);
static const Duration receiveTimeout = Duration(seconds: 30);
// Storage Keys
static const String authTokenKey = 'auth_token';
static const String refreshTokenKey = 'refresh_token';
static const String userDataKey = 'user_data';
static const String appSettingsKey = 'app_settings';
// API Endpoints
static const String loginEndpoint = '/auth/login';
static const String refreshEndpoint = '/auth/refresh';
static const String membresEndpoint = '/membres';
static const String cotisationsEndpoint = '/finance/cotisations';
static const String evenementsEndpoint = '/evenements';
static const String statistiquesEndpoint = '/statistiques';
// App Configuration
static const String appName = 'UnionFlow';
static const String appVersion = '2.0.0';
static const int maxRetryAttempts = 3;
// Pagination
static const int defaultPageSize = 20;
static const int maxPageSize = 100;
// File Upload
static const int maxFileSize = 10 * 1024 * 1024; // 10MB
static const List<String> allowedImageTypes = ['jpg', 'jpeg', 'png', 'gif'];
static const List<String> allowedDocumentTypes = ['pdf', 'doc', 'docx'];
// Chart Colors
static const List<String> chartColors = [
'#2196F3', '#4CAF50', '#FF9800', '#F44336',
'#9C27B0', '#00BCD4', '#8BC34A', '#FFEB3B'
];
}
class ApiEndpoints {
// Authentication
static const String login = '/auth/login';
static const String logout = '/auth/logout';
static const String register = '/auth/register';
static const String refreshToken = '/auth/refresh';
static const String forgotPassword = '/auth/forgot-password';
// Membres
static const String membres = '/membres';
static const String membreProfile = '/membres/profile';
static const String membreSearch = '/membres/search';
static const String membreStats = '/membres/statistiques';
// Cotisations
static const String cotisations = '/finance/cotisations';
static const String cotisationsPay = '/finance/cotisations/payer';
static const String cotisationsHistory = '/finance/cotisations/historique';
static const String cotisationsStats = '/finance/cotisations/statistiques';
// Événements
static const String evenements = '/evenements';
static const String evenementParticipants = '/evenements/{id}/participants';
static const String evenementDocuments = '/evenements/{id}/documents';
// Dashboard
static const String dashboardStats = '/dashboard/statistiques';
static const String dashboardCharts = '/dashboard/charts';
static const String dashboardNotifications = '/dashboard/notifications';
}