delgraf / module-passkey-auth-popup
Adds passkey (WebAuthn) sign-in to Magento 2's authentication popup, as an add-on for mage-os/module-passkey-auth
Package info
github.com/Delgraf/Magento2-PasskeyAuthPopup
Language:JavaScript
Type:magento2-module
pkg:composer/delgraf/module-passkey-auth-popup
Requires
- php: >=8.2
- mage-os/module-passkey-auth: ^1.0
- magento/framework: *
- magento/module-customer: *
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Delgraf_PasskeyAuthPopup is a small add-on for mage-os/module-passkey-auth.
That module adds passkey (WebAuthn) sign-in to the customer login page, but not to Magento's authentication popup: the "Sign In" modal that many Luma-based themes open from the header account menu. This add-on brings passkey sign-in to that popup.
Features
- A Sign in with Passkey button below the popup's login form, styled with the base module's CSS classes.
- Passkey suggestions in the email field's autofill dropdown (WebAuthn conditional mediation), in browsers that support it.
- After a passkey sign-in the current page reloads, like the popup's password sign-in, and private content (header, minicart) is refreshed.
- Autofill is armed only when the popup opens, so normal page views don't request WebAuthn challenges or use up the base module's per-IP rate limit.
- Turns itself off on the login page and on checkout, where the base module already handles passkeys.
- Follows the base module's Enable Passkey Authentication setting and renders nothing for signed-in customers.
- No PHP classes, database tables or configuration of its own.
Requirements
- Magento Open Source / Adobe Commerce 2.4.x or Mage-OS, PHP 8.2+
- mage-os/module-passkey-auth 1.x, enabled and configured
- A Luma-based theme that uses the core authentication popup (
Magento_Customer/js/view/authentication-popup). Hyvä themes are not supported. - HTTPS (required by WebAuthn)
Installation
Run all commands from the Magento root directory, as the user that owns the Magento files. Back up your code and database first, and try the module on a staging site before production.
Install and enable mage-os/module-passkey-auth first. With Composer it is installed automatically as a dependency, but it must still be configured.
Option 1: Composer (recommended)
-
Put the store in maintenance mode (production stores only):
bin/magento maintenance:enable
-
Download the module:
composer require delgraf/module-passkey-auth-popup
-
Enable the module and update Magento:
bin/magento module:enable Delgraf_PasskeyAuthPopup bin/magento setup:upgrade
-
In production mode, compile and deploy static content. List every locale your store views use, for example
en_US it_IT:bin/magento setup:di:compile bin/magento setup:static-content:deploy en_US it_IT
-
Clear the cache and leave maintenance mode:
bin/magento cache:flush bin/magento maintenance:disable
Option 2: Manual (app/code)
- Download the latest version as a ZIP from the Tags page and extract it.
- Copy its contents to
app/code/Delgraf/PasskeyAuthPopup/, so thatregistration.phpis atapp/code/Delgraf/PasskeyAuthPopup/registration.php. - Run steps 1 and 3 to 5 of the Composer installation.
Check the installation
-
Check that the module is enabled:
bin/magento module:status Delgraf_PasskeyAuthPopup
-
Make sure Enable Passkey Authentication is set to Yes (see Configuration).
-
On the storefront, sign out, open the account menu and click Sign In. The popup should show a Sign in with Passkey button below the login form.
Update
Read the CHANGELOG before updating, and back up your code and database. The module follows Semantic Versioning: minor and patch versions (1.x) are backward compatible, while a new major version (2.0) may need changes on your side.
Installed with Composer
-
Check the installed version and whether a newer one is available:
composer show delgraf/module-passkey-auth-popup composer outdated delgraf/module-passkey-auth-popup
-
Put the store in maintenance mode (production stores only):
bin/magento maintenance:enable
-
Update the package. This stays within the version range in your
composer.json(for example^1.0), so it never jumps to a new major version:composer update delgraf/module-passkey-auth-popup
To move to a new major version, change the constraint on purpose, for example
composer require delgraf/module-passkey-auth-popup:^2.0. -
Update Magento, recompile and redeploy static content (production mode), then clear the cache and leave maintenance mode:
bin/magento setup:upgrade bin/magento setup:di:compile bin/magento setup:static-content:deploy en_US it_IT bin/magento cache:flush bin/magento maintenance:disable
Installed manually (app/code)
-
Download the new version as a ZIP from the Tags page and extract it.
-
Put the store in maintenance mode (step 2 above).
-
Delete the old files and copy in the new ones, so that no file from the old version is left behind:
rm -rf app/code/Delgraf/PasskeyAuthPopup mkdir -p app/code/Delgraf/PasskeyAuthPopup cp -R /path/to/extracted/Magento2-PasskeyAuthPopup-x.y.z/. app/code/Delgraf/PasskeyAuthPopup/
-
Run step 4 above.
After updating
- Check the version:
composer show delgraf/module-passkey-auth-popup, or theCHANGELOG.mdin the module folder for a manual installation. - Test the popup sign-in as described in Check the installation.
- If the old button still appears, clear your browser cache or test in a private window: the browser may keep the old JavaScript file.
When you update mage-os/module-passkey-auth, check this add-on still works too, since it uses the base module's JavaScript and endpoints.
Configuration
There is nothing to configure. Turn on passkeys in the base module:
Stores > Configuration > Customers > Customer Configuration > Passkey Authentication > Enable Passkey Authentication = Yes
Translations
The button and messages reuse the base module's strings, so any translation of mage-os/module-passkey-auth (module CSV, language pack or theme) also translates this add-on.
How it works
view/frontend/layout/default.xmladds a block tobefore.body.end, using the base module'sConditionalLoginblock for the endpoint URLs and the signed-in check.view/frontend/web/js/popup-passkey.jswaits for the popup's login form, inserts the button and starts autofill on the core modal'smodalopenedevent. The WebAuthn ceremony goes through the base module'spasskey-core.jsand endpoints, so all security checks (challenge handling, rate limiting, account checks) stay in the base module.checkout_index_index.xmlandcustomer_account_login.xmlremove the block on those pages, since a browser allows only one active WebAuthn request.
Uninstall
The module stores no data and adds no database tables or configuration, so removing its code is all it takes. Customers' passkeys belong to mage-os/module-passkey-auth and are not affected: they keep working on the login page.
To only hide the button for a while, disable the module (step 2) and skip removing the files.
Installed with Composer
-
Put the store in maintenance mode (production stores only):
bin/magento maintenance:enable
-
Disable the module:
bin/magento module:disable Delgraf_PasskeyAuthPopup
-
Remove the package:
composer remove delgraf/module-passkey-auth-popup
-
Update Magento, recompile and redeploy static content (production mode), then clear the cache and leave maintenance mode:
bin/magento setup:upgrade bin/magento setup:di:compile bin/magento setup:static-content:deploy en_US it_IT bin/magento cache:flush bin/magento maintenance:disable
Alternatively, bin/magento module:uninstall Delgraf_PasskeyAuthPopup does steps 2 and 3 in one command, also for Composer installations only.
Installed manually (app/code)
-
Run steps 1 and 2 above.
-
Delete the module folder:
rm -rf app/code/Delgraf/PasskeyAuthPopup
If
app/code/Delgraf/is now empty, you can delete it too. -
Run step 4 above.
Removing the base module too
This module depends on mage-os/module-passkey-auth. Uninstall this add-on first; Magento refuses to disable the base module while Delgraf_PasskeyAuthPopup is still enabled.
License
OSL-3.0 (Open Software License 3.0)