simplici_auth_flutter 1.3.9
simplici_auth_flutter: ^1.3.9 copied to clipboard
A Flutter package for integrating SimpliciAuth with Google OAuth in Flutter applications. Provides webview-based authentication with customizable configuration and comprehensive OAuth handling.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
1.3.9 - 2025-01-16 #
Added #
- Package version update for release
- Enhanced stability and performance improvements
1.3.8 - 2025-01-16 #
Fixed #
- Resolved package publication visibility issues on pub.flutter-io.cn
- Confirmed version 1.3.7 was successfully published to pub.flutter-io.cn
1.3.7 - 2025-01-16 #
Added #
- Added debug alert to show complete sso_user_data content for Google authentication
- Fixed syntax error in config file comment formatting
1.3.5 - 2025-01-16 #
Changed #
- Updated baseUrl to use development tunnel URL for testing
- Changed jsPath from "/static/js/main.js" to "/static/js/bundle.js"
- Updated tests to match new configuration values
1.3.4 - 2025-01-16 #
Fixed #
- Fixed handleHooks response returning null by using Promise pattern for better async JavaScript handling
- Fixed hookResult data storage to properly pass handleHooks response data to sso_user_data for Google authentication
- Ensured handleHooks response data is correctly stored as Map object instead of JSON string
1.3.3 - 2025-01-16 #
Fixed #
- Fixed all JavaScript console.log statements to properly stringify objects instead of showing "[object Object]"
- Fixed handleHooks response, Google config, callback functions, and component attributes logging
1.3.2 - 2025-01-16 #
Changed #
- Improved logging consistency by stringifying hookResult in Dart logs and payload in JavaScript console logs
1.3.1 - 2025-01-16 #
Changed #
- Stringify hookResult as JSON string instead of raw Map object for better serialization
1.1.7 - 2025-01-16 #
Added #
- handleHooks integration: Added automatic call to
window.handleHooks
for Google OAuth authentication - Hook payload support: Sends complete payload with provider, access_token, code, redirect_url, instanceId, type, and responseType
- Hook response handling: Processes handleHooks response and uses
res.data
for sso_user_data when available - Enhanced user data structure: Added redirect_url field and standardized type as 'embeded' for Google OAuth
Changed #
- sso_user_data source: Now uses handleHooks response data when available, falling back to standard user data
- Google OAuth type: Changed default type from 'login' to 'embeded' for Google authentication
- Data flow: Enhanced data flow to include handleHooks integration in the authentication process
Improved #
- Error handling: Added comprehensive error handling for handleHooks calls
- Logging: Enhanced logging for handleHooks calls and responses
- JavaScript integration: Improved JavaScript execution for hook calls with proper async/await handling
1.1.6 - 2025-01-16 #
Fixed #
- Duplicate callback processing: Added flag to prevent duplicate OAuth callback processing
- False error reporting: Fixed "failed to extract user data" error appearing after successful authentication
- Race condition handling: Improved handling of race conditions between popup closure and callback processing
- Authentication state tracking: Added proper tracking to prevent multiple processing of the same authentication
Changed #
- Error reporting logic: Enhanced error reporting to only show errors when authentication hasn't been processed successfully
- Callback flow: Improved OAuth callback flow to reset processing flag on new authentication attempts
1.1.5 - 2025-01-16 #
Fixed #
- WebView disposal error: Fixed "IOSInAppWebViewController was used after being disposed" error for Google OAuth
- Popup closure timing: Added delay before closing popup to allow OAuth callback processing to complete
- Error handling: Enhanced error handling for disposed webview controllers without failing authentication
- Graceful degradation: Authentication flow continues successfully even if sso_user_data UI update fails
Changed #
- OAuth callback processing: Improved callback processing to handle webview disposal gracefully
- Error reporting: Changed from throwing exceptions to logging warnings for non-critical webview errors
1.1.4 - 2025-01-16 #
Added #
- Google OAuth iOS scheme handling: Added specific handling for Google OAuth with iOS scheme URLs
- Enhanced Google auth completion: Popup now only closes when OAuth code is received for Google authentication
- Google-specific token logging: Added dedicated logging for Google OAuth access tokens and codes
- iOS redirect URI support: Enhanced iOS scheme redirect URI handling for Google OAuth
Changed #
- OAuth completion detection: Modified completion detection to specifically handle Google OAuth redirects with iOS scheme URLs
- Google OAuth flow: Improved Google OAuth flow to use iOS scheme URLs as redirect URIs
- Token exchange logging: Enhanced logging for Google OAuth token exchange with iOS scheme redirect URIs
- Callback processing: Updated callback processing to prioritize Google OAuth code handling
Fixed #
- Popup closure timing: Fixed popup closure to only occur when Google OAuth code is received
- iOS scheme URL handling: Fixed iOS scheme URL handling for Google OAuth redirects
1.1.0 - 2025-01-12 #
1.1.3 - 2025-01-12 #
Fixed #
- Fixed dynamic type parameter handling in user data extraction
- Resolved issue where Google OAuth flow was trying to access non-existent 'type' field from Google API response
- Enhanced type parameter extraction to properly use original OAuth params with fallback to 'login'
1.1.2 - 2025-01-12 #
Fixed #
- Fixed OAuth callback processing to only execute when URL contains actual completion indicators (email, errorCode, userId, etc.)
- Resolved "Failed to extract user data from params" error for intermediate Microsoft OAuth URLs
- Improved auth completion detection to prevent processing of OAuth authorization URLs that don't contain user data
1.1.1 - 2025-01-12 #
Fixed #
- Fixed boolean attributes in webcomponent HTML to properly convert to string values
- Improved compatibility with JavaScript frameworks by explicitly converting boolean values to "true"/"false" strings
Added #
- Complete webcomponent props support: Added all missing properties to match the SimpliciAuth webcomponent specification:
page
: Specify the page to displaylang
: Language code (e.g., 'en', 'es', 'fr')hideNavigation
: Whether to hide navigation elementsmicrosoftRedirectUrl
: Microsoft OAuth redirect URLfacebookRedirectUrl
: Facebook OAuth redirect URLappleRedirectUrl
: Apple OAuth redirect URLgoogleRedirectUrl
: Google OAuth redirect URLonLoaded
: Callback when component is loaded
- Enhanced configuration: All webcomponent properties now available in SimpliciAuthConfig
- Comprehensive documentation: Updated README with all available properties and their descriptions
Changed #
- Major version bump: Significant API expansion with all webcomponent properties now supported
- Improved webcomponent generation: Dynamic attribute generation based on configured properties
1.0.7 - 2025-01-12 #
Fixed #
- Memory leak prevention: Added
mounted
checks before allsetState()
calls in PopupBrowser to prevent "setState() called after dispose()" errors - Widget lifecycle management: Enhanced PopupBrowser disposal handling to prevent callbacks from executing after widget is removed from tree
- Async callback safety: Protected all WebView navigation callbacks (onPageStarted, onPageFinished, onUrlChange) from calling setState on disposed widgets
Security #
- Memory safety: Prevents potential memory leaks by properly handling widget lifecycle in popup browser
1.0.6 - 2025-01-12 #
Fixed #
- Webcomponent sso_user_data setting: Properly set sso_user_data directly on the simplici-auth webcomponent element
- Multiple data setting methods: Set sso_user_data as both attribute and property on webcomponent for maximum compatibility
- JSON stringify format: Convert all authentication parameters to proper JSON.stringify format as required
- Event dispatching: Enhanced event dispatching to trigger events both on webcomponent and globally
- Complete data inclusion: Include all authentication parameters in sso_user_data object
Added #
- Webcomponent method calling: Call setSSOUserData method on webcomponent if available
- Comprehensive logging: Added detailed logging for webcomponent interaction and data setting
- Error handling: Added try-catch for JavaScript execution to prevent failures
1.0.5 - 2025-01-12 #
Fixed #
- sso_user_data format: Simplified sso_user_data to match original working format with just essential fields (provider, email, firstName, lastName, userId, instanceId, type, responseType)
- Data setting method: Fixed webview data setting to use correct format and trigger proper webcomponent events
- Browser popup closure: Ensured popup browser closes properly after authentication completion
- Event notification: Added proper event dispatching (sso-auth-complete) to notify webcomponent of successful authentication
Changed #
- Simplified data structure: Removed complex nested data structures in favor of simple, flat sso_user_data format
- Enhanced event handling: Added multiple event triggers (handleSSOComplete, onAuthenticationComplete, CustomEvent) to ensure webcomponent receives authentication data
1.0.4 - 2025-01-12 #
Enhanced #
- sso_user_data setting: Enhanced and guaranteed sso_user_data setting for ALL authentication providers (Google, Facebook, Apple, etc.)
- Comprehensive logging: Added detailed step-by-step logging for authentication flow and sso_user_data setting process
- Data verification: Added JavaScript-side verification to ensure sso_user_data is properly accessible in webview
- Error handling: Improved error handling with explicit error throwing for sso_user_data setting failures
- Multi-provider support: Ensured consistent sso_user_data format across all OAuth providers
Added #
- Provider-specific logging: Each authentication step now logs the provider type for better debugging
- Data accessibility verification: JavaScript verification that sso_user_data is properly set and accessible
- Enhanced completion handlers: Added support for multiple completion callback types (handleAuthCompletion, onSSOComplete)
1.0.3 - 2025-01-12 #
Fixed #
- Direct user data handling: Added support for providers that return user data directly in URL parameters (like Facebook)
- Universal OAuth callback: Enhanced OAuth callback handling to process both token-based flows (Google) and direct data flows (Facebook, etc.)
- Parameter extraction: Improved URL parameter extraction with proper URL decoding for names and special characters
- Auth completion detection: Enhanced popup browser to detect more auth completion URL patterns
- sso_user_data completeness: Ensure all available user information from params is included in sso_user_data
Changed #
- OAuth flow flexibility: Support for multiple OAuth response types (code exchange vs direct user data)
- Enhanced parameter parsing: Better handling of URL-encoded parameters and special characters
- Improved debugging: Consistent debug logging across all browser components
1.0.2 - 2025-01-12 #
Fixed #
- Browser UI: Changed from full-screen InternalBrowser to popup-style dialog browser (PopupBrowser) for better user experience
- User data extraction: Added comprehensive user data extraction including firstName, lastName, email, and userId
- sso_user_data: Implemented proper sso_user_data setting in webview with JSON stringified format
- OAuth token exchange: Added complete OAuth flow with token exchange and user info retrieval from Google API
- Auto-close functionality: Browser now automatically closes after successful authentication
Changed #
- Authentication flow: Complete OAuth 2.0 flow with proper token exchange and user data retrieval
- Browser style: Popup dialog style instead of full-screen with AppBar for better UX
- Data handling: Comprehensive user data structure with all required fields
1.0.1 - 2025-01-12 #
Fixed #
- onStepChanged URL handling: Restored functionality to automatically open URLs in internal browser when triggered by step change events
- Event data parsing: Improved parsing of step change event data to properly extract URLs and other parameters
- Internal browser integration: Fixed integration with internal browser for OAuth flows
- Google OAuth configuration: Enhanced extraction and handling of Google OAuth configuration from instance details
Changed #
- WebView implementation: Updated to use webcomponent HTML generation instead of direct URL loading for better event handling
- Event handlers: Added proper JavaScript handlers for step changes and auth completion events
- Debug logging: Improved debug logging for better troubleshooting of authentication flows
1.0.0 - 2025-01-12 #
Added #
- Initial release of SimpliciAuth Flutter package
- SimpliciAuthWebView: Main widget for displaying authentication interface
- SimpliciAuthConfig: Configuration class with comprehensive customization options
- Cross-platform support: Works on iOS, Android, Web, macOS, Linux, and Windows
- OAuth integration: Complete OAuth 2.0 flow with Google
- Callback support: Multiple callback functions for different authentication events
- Debug mode: Optional debug logging for development
- Custom styling: Support for custom CSS and user agents
- Example app: Complete example demonstrating package usage
Features #
- Configurable instance ID, environment, and platform settings
- Support for combined input and auto navigation options
- Token exchange and user data retrieval
- Error handling and success callbacks
- Internal browser for OAuth flows
- Comprehensive documentation and README