Emirates ID Reader Integration with Flutter via Aamen Portal (PAP) Services

Mohamed Abdo Elnashar
Flutter UAE
Published in
5 min readJan 5, 2024

Streamlined Emirates ID Reader Integration: PAP Services Optimized for Flutter on WEB and Windows.

The AAMEN program is a significant initiative by the Department of Health, Abu Dhabi to ensure healthcare information in the Emirate of Abu Dhabi.

Patient Authentication Platform (PAP) electronically authenticates patient’s identity via Emirates ID Card and fingerprint during encounters with health care providers.

  • Supported OS: Windows 10
  • Supported Browser: Microsoft Edge, Firefox, Chrome

Supported Card Readers:

Installation PAP Service Client

Once you have received the installation package from AAMEN, store it in a location accessible by the endpoint where you want the PAP installed, you can download four files from the AAMEN account :

  1. PapService_AK_2023–05–25.zip (PAP service exe file)
  2. MSO USB Driver 4.7.0.0.zip (Driver files for MSO reader)
  3. SecuGenWBFDriverInstaller_25.zip (Driver files for SecuGen reader)
  4. Certificate file <xxxx>.pfx (Client Side Authentication certificate)

Install PapService by running exe

Enter the license number as a Username, the Password is123456” and the Client certificate name is the facility license number (MFXXXX:Provider).

Install Certificate

Certificate file <xxxx>.pfx for Local Computer (not Current User) with Password “123456”.

Install MSO USB Driver

After installation, you will find in the taskbar (eventually hidden, need to be pulled down) two indicator “LEDs”.

Once the installation package is successfully installed, connect to the URL below to reach the PAP platform:

Config Files: The config files can be found:

  • C:\Program Files\PapService\PapStatus\PapStatus.exe.Config

And you can switch read public data from online or offline

Run PAP Service

We can run the service by going to the start menu and selecting PapService

Click browse to select pap status.

Selected PapStatus.exe from the PapStatus folder in the PapService folder

it’s started now Go to http://localhost/PapService

REST API (GetPublicData)

Post a request with an empty body on the following URL:

Flutter Implementation

We will create a Flutter project (pap).

flutter create pap

This project will contain only one function which is to read the Emirates ID data, and we will use the DIO library.

dependencies:
dio: ^5.3.0

Function (getPublicData) to call HTTP request to read data.

import 'package:dio/dio.dart';

Future<void> getPublicData() async {
setState(() => loading = true);
final response =
await Dio().post('http://localhost:80/PapService/publicData');
setState(() => result = jsonDecode(response.data));
log('Response body: ${response.data}');
setState(() => loading = false);
}

Because PapService is only supported on Windows devices and the Web, we can only run the Flutter Windows version And the Flutter Web version

The Emirates ID reader is connected to the device PC via USB, and the ID is set to read its data.

Image from the internet for Reader and ID

Note: if you did not register this device in PapService Open Register Device exe in PapService Folder in Program File in /C and click the register device button after the Connect reader via USB.

Flutter Web Version

We can run the web version by selecting the device to use “Chrome Web” and selecting Start debugging from the Run Tab.

Output for running the Flutter web version

Flutter Windows Version

We can run the Windows version by selecting the device to use “Windows windows-x64” and selecting Start debugging from the Run Tab.

Output for running the Flutter Windows version

Emirates ID card chip all public attributes are being returned:

  • ArabicFullName • CardHolderDataSf5Signature • CardNumber
    • CardSerialNumber • CompanyName • CompanyNameArabic
    • DateOfBirth • DateOfGraduation • DegreeDescription
    • DegreeDescriptionArabic • ExpiryDate • FamilyId • FieldOfStudy
    • FieldOfStudyArabic • FieldOfStudyCode • FingerData • FullName
    • HomeAddressAreaArabic • HomeAddressAreaCode
    • HomeAddressAreaEnglish • HomeAddressBuildingName
    • HomeAddressBuildingNameArabic • HomeAddressCityArabic
    • HomeAddressCityCode • HomeAddressCityDescription
    • HomeAddressEmail • HomeAddressEmirateArabic
    • HomeAddressEmirateDescription • HomeAddressFlatNumber
    • HomeAddressLandPhoneNumber • HomeAddressLocationCode •. HomeAddressStreetEnglish • HomeAddressTypeCode
    • HusbandIdNumber • IDType • IdNumber • IssueDate • MaritalStatus
    • MotherFirstName • MotherFullNameArabic • Nationality • NationalityAR
    • NationalityCode • Occupation • OccupationArabic • OccupationCode
    • OccupationFieldCode • OccupationType • OccupationTypeArabic
    • PassportCountryCode • PassportExpiryDate • PassportIssueDate
    • PassportCountryCodeArabic • PassportCountryDescription
    • PassportNumber • PassportTypeCode • Photography • PlaceOfBirth
    • PlaceOfBirthAR • PlaceOfStudyArabic • PlaceOfStudyEnglish
    • QualificationLeveArabic • HomeAddressMobilePhoneNumber • HomeAddressPoBox • HomeAddressStreet • HomeAddressStreetArabic • ResidencyType • Sex • SponsorName • SponsorTypeCode • Title
    • SponsorUnifiedNumber • TitleArabic • WorkAddressAddressTypeCode
    • WorkAddressAreaArabic • WorkAddressAreaCode
    • WorkAddressAreaEnglish • WorkAddressBuildingNameArabic
    • WorkAddressBuildingNameEnglish • WorkAddressCityArabic
    • WorkAddressCityCode • WorkAddressCityEnglish
    • WorkAddressCompanyNameArabic • WorkAddressCompanyNameEnglish • WorkAddressEmail • WorkAddressEmirateArabic
    • WorkAddressEmirateEnglish • WorkAddressEmiratesCode
    • WorkAddressLandPhoneNumber • WorkAddressLocationCode
    • WorkAddressMobilePhoneNumber • WorkAddressPoBox
    • WorkAddressStreetArabic • WorkAddressStreetEnglish

Resources

DoH — PAP (Technical User Guideline)

I hope you all liked this blog and it helped you start with Flutter! Don’t forget to smash that clap button and comment below.

If you liked this article make sure to 👏 it below, and connect with me on Portfolio, Github, and LinkedIn.

Meet you at the next one.

--

--

Mohamed Abdo Elnashar
Flutter UAE

Senior Flutter Developer, and I study a master of computer science in the faculty of computer & information sciences at Mansoura university