نظرة عامةOverview
على أجهزة Mac بمعالج Apple Silicon، يحتاج SConnect خطوتين قبل ما يشتغل تسجيل الدخول بالبطاقة الذكية (مثل idp.pki.ita.gov.om): تثبيت يدوي، وتشغيل البرنامج المساعد عبر Rosetta.On Apple Silicon Macs, SConnect needs two fixes before smart card login works (for example on idp.pki.ita.gov.om): a manual install, and running its helper under Rosetta.
- المشكلة 1: مثبّت
sconnect-hostيفشل برسالة "The installation failed"، لأن macOS يمنعه من الكتابة في مجلد بيانات Chrome (Operation not permitted).Problem 1: thesconnect-hostinstaller fails with "The installation failed". macOS blocks it from writing into Chrome's data folder (Operation not permitted). - المشكلة 2: بعد التثبيت، تبقى البوابة على "Insert your smart card" حتى لو الجهاز قرأ البطاقة. السبب أن البوابة تنزّل إضافة (add-on) مبنية لمعالجات Intel فقط (
x86_64)، والبرنامج المساعد على Apple Silicon ما يقدر يحمّلها.Problem 2: after installing, the portal stays on "Insert your smart card" even with the card detected. The portal downloads an add-on that is built for Intel only (x86_64), and the Apple Silicon helper can't load it.
جرّبت الخطوات على SConnect host 2.16.1.0 مع Chrome وقارئ بطاقات CCID عادي. كل الأوامر تشغّلها في Terminal بحسابك العادي.Tested with SConnect host 2.16.1.0, Chrome, and a generic CCID card reader. All commands run in Terminal as your normal user.
قبل ما تبدأBefore you start
- جهاز Mac بمعالج Apple Silicon (M1 أو أحدث). على أجهزة Intel تخطَّ الخطوة 4.An Apple Silicon Mac (M1 or later). On Intel Macs, skip Step 4.
- Google Chrome أو Firefox. SConnect ما يشتغل على Safari.Google Chrome or Firefox. SConnect does not work in Safari.
- قارئ بطاقات USB، وبطاقة هوية مفعّلة مع الرقم السري (PIN).A USB smart card reader and an activated ID card with its PIN.
- ملف تثبيت SConnect host، مثلاً
sconnect-host-v2.16.1.0.pkg، محفوظ في مجلد Downloads.The SConnect host installer, for examplesconnect-host-v2.16.1.0.pkg, saved in Downloads. - إذا استخدمت SConnect من قبل، اقفل Chrome أولاً (Cmd+Q).If you used SConnect before, quit Chrome first (Cmd+Q).
الخطوة 1: تثبيت برنامج SConnect المساعدStep 1: Install the SConnect helper
جرّب ملف .pkg أولاً. إذا طلعت لك رسالة "The installation failed"، تأكّد من السبب في سجل التثبيت:Try the .pkg first. If it ends with "The installation failed", confirm the cause in the install log:
grep -iE "sconnect|error|fail" /var/log/install.log | tail -40
إذا شفت error opening dstPath=.../Google/Chrome: Operation not permitted، ثبّت الملفات يدوياً. الحزمة تكتب بس في مجلد ~/Library الخاص فيك، فالنسخ العادي يكفي:If you see error opening dstPath=.../Google/Chrome: Operation not permitted, install the files by hand. The package only writes to your own ~/Library, so a plain copy does the same job:
pkgutil --expand-full ~/Downloads/sconnect-host-v2.16.1.0.pkg /tmp/sconnect P="/tmp/sconnect/sconnect.pkg/Payload/Library/Application Support" A="$HOME/Library/Application Support" mkdir -p "$A/SConnect" "$A/Google/Chrome/NativeMessagingHosts" "$A/Mozilla/NativeMessagingHosts" cp "$P/SConnect/sconnect" "$P/SConnect/uninstall.sh" "$A/SConnect/" chmod +x "$A/SConnect/sconnect" xattr -c "$A/SConnect/sconnect" sed "s#UserPath#$HOME#g" "$P/Google/Chrome/NativeMessagingHosts/com.gemalto.sconnect.json" > "$A/Google/Chrome/NativeMessagingHosts/com.gemalto.sconnect.json" sed "s#UserPath#$HOME#g" "$P/Mozilla/NativeMessagingHosts/com.gemalto.sconnect.json" > "$A/Mozilla/NativeMessagingHosts/com.gemalto.sconnect.json" grep path "$A/Google/Chrome/NativeMessagingHosts/com.gemalto.sconnect.json"
آخر سطر لازم يطبع مسار مجلدك الرئيسي وبعده /Library/Application Support/SConnect/sconnect. إذا سألك macOS هل يقدر Terminal يوصل لبيانات تطبيقات ثانية، اضغط Allow.The last line should print your home path followed by /Library/Application Support/SConnect/sconnect. If macOS asks whether Terminal can access data from other apps, click Allow.
إذا في ملفات باقية من تثبيت قديم لـ SConnect (مجلد addons وملف sconnect.db بتواريخ قديمة)، حطّها على جنب عشان يبدأ البرنامج المساعد من الصفر:If an older SConnect install left files behind (addons and sconnect.db dated years back), move them aside so the helper starts clean:
cd ~/Library/Application\ Support/SConnect mv addons addons.old mv sconnect.db sconnect.db.old
الخطوة 2: تثبيت إضافة المتصفحStep 2: Install the browser extension
- ثبّت إضافة SConnect من Chrome Web Store. لازم يكون معرّفها
mjhbkkaddmmnkghdnnmkjcgpphnopnfk، لأنها الإضافة الوحيدة اللي يقبلها البرنامج المساعد.Install the SConnect extension from the Chrome Web Store. Its ID must bemjhbkkaddmmnkghdnnmkjcgpphnopnfk, the only extension the helper accepts. - افتح
chrome://extensions، اضغط SConnect ← Details، وخلّ Site access على On all sites.Openchrome://extensions, click SConnect → Details, and set Site access to On all sites. - اقفل Chrome بالكامل (Cmd+Q) وافتحه من جديد.Quit Chrome (Cmd+Q) and open it again.
عشان تتأكّد إن Chrome يقدر يشغّل البرنامج المساعد، فعّل Developer mode في chrome://extensions، اضغط رابط service worker الخاص بالإضافة، وشغّل هذا في Console:To confirm Chrome can start the helper, turn on Developer mode in chrome://extensions, click the extension's service worker link, and run this in its Console:
chrome.runtime.sendNativeMessage('com.gemalto.sconnect', {}, r => console.log(r, chrome.runtime.lastError))بعدها شغّل pgrep -fl sconnect في Terminal. إذا شفت عملية sconnect شغّالة، معناه الإضافة والبرنامج المساعد متصلين.Then run pgrep -fl sconnect in Terminal. A running sconnect process means the extension and helper are connected.
الخطوة 3: التأكد من القارئ والبطاقةStep 3: Check the reader and card
ركّب القارئ مباشرة في الجهاز (بدون hub)، دخّل البطاقة، وشغّل:Plug the reader straight into the Mac (avoid hubs), insert the card, and run:
for i in {1..10}; do system_profiler SPSmartCardsDataType | grep -m1 "#01"; sleep 1; doneالأسطر العشرة كلها لازم يطلع فيها ATR:{...}، وهذا معناه إن البطاقة تستجيب.All ten lines should show ATR:{...}, which means the card is answering.
- إذا كل الأسطر
no card present: اقلب البطاقة. الاتجاه اللي يطلّع ATR هو الصح.no card presenton every line: flip the card. The orientation that shows an ATR is the right one. - إذا طلع خليط بين ATR و
no card presentوالبطاقة ما تحرّكت: القارئ يفقد الاتصال بالبطاقة. دخّلها للآخر، غيّر المنفذ، أو جرّب قارئ ثاني.A mix of ATR andno card presentwith the card left in: the reader is losing contact. Push the card in firmly, change port, or use another reader.
البطاقة ما راح تظهر تحت "Available SmartCards"، وهذا طبيعي: SConnect يقرأها من القارئ مباشرة، مو من Keychain.The card won't appear under "Available SmartCards". That's normal: SConnect reads it through the reader directly, not the macOS keychain.
الخطوة 4: تشغيل البرنامج المساعد عبر Rosetta (Apple Silicon)Step 4: Run the helper under Rosetta (Apple Silicon)
هذي الخطوة اللي تخلّي خانة الرقم السري تظهر. البرنامج المساعد نفسه يدعم Apple Silicon، لكن الإضافة اللي تنزّلها البوابة في ~/Library/Application Support/SConnect/addons مبنية لـ Intel فقط. العملية اللي تشتغل على Apple Silicon ما تقدر تحمّل مكتبة Intel، فالبرنامج ما يقرأ البطاقة أبداً.This is the step that makes the PIN field appear. The helper itself supports Apple Silicon, but the add-on the portal downloads into ~/Library/Application Support/SConnect/addons is Intel-only. An Apple Silicon process can't load an Intel library, so the card is never read.
للتأكد، افتح البوابة مرة وحدة، وبعدها شغّل:To confirm, open the portal once, then run:
file ~/Library/Application\ Support/SConnect/addons/*/*/addon.dylib
إذا طلع x86_64 بس، طبّق الحل:If it shows only x86_64, apply the fix:
softwareupdate --install-rosetta --agree-to-license
pkill sconnect
S="$HOME/Library/Application Support/SConnect"
printf '#!/bin/sh\nexec /usr/bin/arch -x86_64 "%s/sconnect" "$@"\n' "$S" > "$S/sconnect-x86"
chmod +x "$S/sconnect-x86"
xattr -dr com.apple.quarantine "$S/addons"
for f in "$HOME/Library/Application Support/Google/Chrome/NativeMessagingHosts/com.gemalto.sconnect.json" \
"$HOME/Library/Application Support/Mozilla/NativeMessagingHosts/com.gemalto.sconnect.json"; do
sed -i '' 's#/SConnect/sconnect"#/SConnect/sconnect-x86"#' "$f"
done
grep path "$HOME/Library/Application Support/Google/Chrome/NativeMessagingHosts/com.gemalto.sconnect.json"آخر سطر لازم ينتهي بـ /SConnect/sconnect-x86. الأوامر هذي تسوي مشغّل صغير يشغّل البرنامج المساعد بوضع Intel، وتوجّه Chrome وFirefox له.The last line should end in /SConnect/sconnect-x86. This creates a small launcher that starts the helper in Intel mode and points Chrome and Firefox at it.
التحقق وحل المشاكلVerify and troubleshoot
خلّ البطاقة في القارئ، اقفل Chrome (Cmd+Q)، افتحه، وافتح البوابة. لازم تظهر خانة الرقم السري، ونافذة SConnect في شريط الأدوات لازم تبيّن Status: active لدومين البوابة.With the card inserted, quit Chrome (Cmd+Q), open it, and load the portal. The PIN field should appear. The SConnect toolbar popup should show Status: active for the portal's domain.
| العرَضSymptom | السبب المحتملLikely cause | الحلFix |
|---|---|---|
| المثبّت: "The installation failed"Installer: "The installation failed" | macOS يمنع الكتابة في مجلد بيانات ChromemacOS blocks writes to Chrome's data folder | الخطوة 1، التثبيت اليدويStep 1, manual install |
| البوابة: "SConnect not detected"Portal: "SConnect not detected" | الإضافة مو مثبّتة، أو صلاحية المواقع محدودةExtension missing, or site access restricted | الخطوة 2Step 2 |
| اختبار Console: "native messaging host not found"Console test: "native messaging host not found" | ملف الربط ناقص أو المسار غلطConnector file missing or wrong path | أعد تشغيل أسطر sed في الخطوة 1Re-run the sed lines in Step 1 |
| اختبار Console: "access ... is forbidden"Console test: "access ... is forbidden" | معرّف الإضافة غلطWrong extension ID | ثبّت إضافة SConnect الرسميةInstall the official SConnect extension |
| البوابة واقفة على "Insert your smart card" والبطاقة تطلّع ATRPortal stuck on "Insert your smart card", card shows an ATR | إضافة Intel فقط على Apple SiliconIntel-only add-on on Apple Silicon | الخطوة 4Step 4 |
system_profiler يطلّع no card presentsystem_profiler shows no card present | البطاقة مقلوبة أو ما داخلة زينCard upside down or loose | الخطوة 3Step 3 |
وجودك برّا عُمان ما يؤثّر على فحص البطاقة، لأنه يصير كله على جهازك.Being outside Oman doesn't affect the card check: it runs entirely on your Mac.
التراجع أو إلغاء التثبيتUndo or uninstall
للرجوع للبرنامج المساعد الأصلي (مثلاً لما تنزّل Thales إضافة تدعم Apple Silicon):To go back to the native helper (for example once Thales ships an Apple Silicon add-on):
for f in "$HOME/Library/Application Support/Google/Chrome/NativeMessagingHosts/com.gemalto.sconnect.json" \
"$HOME/Library/Application Support/Mozilla/NativeMessagingHosts/com.gemalto.sconnect.json"; do
sed -i '' 's#/SConnect/sconnect-x86"#/SConnect/sconnect"#' "$f"
doneلإزالة SConnect بالكامل، احذف إضافة المتصفح، وبعدها احذف هذي:To remove SConnect completely, uninstall the browser extension, then delete these:
~/Library/Application Support/SConnect~/Library/Application Support/SConnect~/Library/Application Support/Google/Chrome/NativeMessagingHosts/com.gemalto.sconnect.json~/Library/Application Support/Google/Chrome/NativeMessagingHosts/com.gemalto.sconnect.json~/Library/Application Support/Mozilla/NativeMessagingHosts/com.gemalto.sconnect.json~/Library/Application Support/Mozilla/NativeMessagingHosts/com.gemalto.sconnect.json