SiaraShield Flutter
siarashield_flutter is a package that enables authentication using SiaraShield in Flutter applications.
Getting Started
To use this package, add siarashield_flutter as a dependency in your pubspec.yaml file.
Installation
Add the following line to your pubspec.yaml:
dependencies:
siarashield_flutter: latest_version
Then, run:
flutter pub get
Usage
To authenticate using SiaraShield, you need a MasterUrlId, which can be obtained from the SiaraShield Portal after registering your package name.
Minimal Example
import 'package:siarashield_flutter/siarashield_flutter.dart';
CyberSiaraWidget(
loginTap: (bool isSuccess) {
if (isSuccess) {
// Handle successful authentication
print("Authentication Successful: \$isSuccess");
} else {
// Handle authentication failure
print("Authentication Failed");
}
},
cyberSiaraModel: CyberSiaraModel(
masterUrlId: 'TEST-CYBERSIARA', // Master URL ID
requestUrl: 'com.app.testapp', //Package name or Website Url
privateKey: 'TEST-CYBERSIARA', // Private Key
),
),
requestUrl
The value of requestUrl depends on the platform:
| Platform | Value |
|---|---|
| Android | Application package name (e.g. com.example.myapp) |
| iOS | Application bundle identifier (e.g. com.example.myapp) |
| Web | Website URL/domain registered in SiaraShield (e.g. https://example.com) |
Important: The value provided in
requestUrlmust exactly match the application package name, bundle identifier, or website URL registered in the SiaraShield Portal.
Parameters
| Parameter | Type | Description |
|---|---|---|
loginTap |
Function | Callback function that returns true on successful authentication and false otherwise. |
masterUrlId |
String | The Master URL ID obtained from SiaraShield Portal. |
requestUrl |
String | The package name registered with SiaraShield. |
privateKey |
String | The private key used for authentication. |
Additional Information
For more details, visit the SiaraShield Portal or refer to the official documentation.
Note: Ensure that you handle authentication responses securely and follow best practices for storing sensitive credentials in your application.
Libraries
- common/custom_widgets
- common/extension_widget
- constants/app_constant
- constants/custom_cache_manager
- constants/custom_cache_manager_native
- constants/custom_cache_manager_stub
- constants/dio_service
- controllers/popoup_controller
- controllers/sara_shield_controller
- models/get_info_model
- models/response_api
- network_image_handler/cached_image_mobile
- network_image_handler/cached_image_web
- network_image_handler/network_image_handler
- popup_screen
- services/browser_name/get_browser_name
- services/browser_name/get_browser_name_mobile
- services/browser_name/get_browser_name_web
- services/generate_random_id
- services/get_device_information
- services/get_ip_address
- siarashield_flutter
- siarashield_flutter_method_channel
- siarashield_flutter_platform_interface
- siarashield_flutter_web