搜索插件、代码仓与 APP 分类

插件详情v1.1.1

flutter_uae_pass

一个支持 iOS、Android 和 Web 平台的 Flutter UAE Pass 插件。这是非官方版本。

AndroidiOSWeb
近 30 天下载
108
喜欢数
17
Pub 分数
130

安装插件

flutter pub add flutter_uae_pass

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

一个 Flutter 插件,可实现与阿联酋电子通行证(UAE Pass)的集成,用于 Android、iOS 和 Web 平台的身份验证。此非官方实现允许用户使用其阿联酋电子通行证凭据进行身份验证,从而简化访问阿联酋政府及私营服务的流程。该插件支持安全令牌获取,并处理平台特定配置,使开发者更轻松地在其应用中实现可信的身份验证。专为需要符合阿联酋数字身份标准的应用程序设计。

适合场景

  • 阿联酋基于政府服务应用程序
  • 需要身份验证的私营部门应用程序
  • 数字开户工作流程
  • 阿联酋居民的安全登录
  • Web 和移动应用身份验证

主要特点

  • 跨平台支持(Android、iOS、Web)
  • 非官方但功能完整的实现
  • 基于令牌的身份验证
  • 支持阿联酋通行证身份验证
  • 通过 pub.dev 的简单集成

适合对象

  • 开发面向阿联酋的应用程序的开发者
  • 需要符合数字身份解决方案的应用程序
  • 需要安全用户认证的项目
  • 针对阿联酋市场的初创企业
  • 前端团队集成第三方认证

使用建议

  • 未获得阿联酋通行证官方认可
  • 可能需要针对新的阿联酋通行证API更改进行更新
  • 与官方插件相比,文档有限
  • 可能需要额外的后端验证
  • 特定于平台的设置步骤可能有所不同

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

flutter_uae_pass

Un-official UAE Pass Flutter plugin for iOS, Android, and Web.

Demo

Platform Screenshots

Android iOS Web
Android iOS Web

Platform Support

Platform Supported Implementation
iOS ✅ WKWebView with full screen modal
Android ✅ Custom WebView Activity
Web ✅ OAuth2 popup authentication

Getting Started

  • Add the plugin to your pubspec.yaml file
flutter_uae_pass: ^1.0.6
  • Run flutter pub get
flutter pub get
  • Import the package
import 'package:flutter_uae_pass/flutter_uae_pass.dart';
final _uaePassPlugin = UaePass();


  • Initialize the plugin - Sandbox
  await _uaePassPlugin.setUpSandbox();
  • Initialize the plugin - Production
    await _uaePassPlugin.setUpEnvironment(
      clientId: "<clientId>",
      clientSecret: "<clientSecret>",
      urlScheme: "myappscheme",
      redirectUri: "<redirectUri>",
      isProduction: true,
      language : "en",
    );

Scopes are as follows

  • urn:uae:digitalid:profile:general
  • urn:uae:digitalid:profile

Main features

  • signIn()
  • getAccessToken(String authCode)
  • getProfile(String token)
  • signOut()

Call the authenticate method

  String? authCode = await _uaePassPlugin.signIn();

To get access token

  String? accessToken = await _uaePassPlugin.getAccessToken(authCode);

To get public profile data

you can fetch this information from profile

  • idn
  • email
  • firstnameAR
  • firstnameEN
  • fullnameEN
  • gender
  • lastnameAR
  • lastnameEN
  • mobile
  • nationalityAR
  • nationalityEN
  • sub
  • userType
  • uuid
  ProfileData? profileData = await _uaePassPlugin.getProfile(accessToken);

iOS Setup

  • Add the following to your Info.plist file

		<key>LSApplicationQueriesSchemes</key>
		<array>
			<string>uaepass</string>
			<string>uaepassqa</string>
			<string>uaepassdev</string>
			<string>uaepassstg</string>
		</array>
		<key>CFBundleURLTypes</key>
		<array>
			<dict>
				<key>CFBundleTypeRole</key>
				<string>Editor</string>
				<key>CFBundleURLName</key>
				<string>myappscheme</string>
				<key>CFBundleURLSchemes</key>
				<array>
					<string>myappscheme</string>
				</array>
			</dict>
		</array>

Android Setup

  • Update android:launchMode="singleTask" the AndroidManifest.xml file

 <activity
            android:name=".MainActivity"
            android:exported="true"
            android:launchMode="singleTask"
            .....

            </activity>

  • Set up the queries in your AndroidManifest.xml file (To make our app open UAE Pass App)
    <queries>
        <package android:name="ae.uaepass.mainapp" />
        <package android:name="ae.uaepass.mainapp.qa" />
        <package android:name="ae.uaepass.mainapp.stg" />
    </queries>

  • Set up the intent filter in your AndroidManifest.xml file (To Reopen our application after uaepass done)
            <intent-filter >
                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />


                <data
                    android:host="success"
                    android:scheme="myappscheme" />

                <data
                    android:host="failure"
                    android:scheme="myappscheme" />

            </intent-filter>

Web Setup

For web applications, no additional configuration is required! The plugin automatically uses a popup-based OAuth2 flow that works in all modern browsers.

Web-Specific Features:
  • Popup Authentication: Opens UAE Pass login in a secure popup window
  • Automatic Redirect Handling: Automatically detects and processes the authorization callback
  • CORS Compliance: Uses proper HTTP requests for token exchange and profile retrieval
  • Session Management: Handles cookies and localStorage for proper logout functionality
Browser Requirements:
  • Modern browsers with popup support (Chrome, Firefox, Safari, Edge)
  • JavaScript enabled
  • Cookies enabled for proper session management
Production Considerations:
  • Ensure your redirect URI is properly configured in the UAE Pass dashboard
  • For production, make sure your domain is whitelisted in UAE Pass configuration
  • Test popup blockers - inform users to allow popups for your domain if needed

References

Thanks for Faisal for this repo uae_pass_flutter i improve the code and create this package

所属分类

依赖

依赖清单 1 项

  • plugin_platform_interface^2.0.2

源码仓库

使用此插件的项目

暂无相关数据。