Username for Magento 2
Let customers register and sign in with a username as well as their email address.
Why choose Username?
Username adds a unique username to customer accounts and lets customers sign in with either their username or their email address. The username is resolved to the account email on the server, so the standard login form, AJAX login and REST token requests all keep working. Uniqueness and format rules are enforced at registration.
At a glance
| Module name | Mage2Expert_Username |
|---|---|
| Composer package | mage2expert/module-username |
| Settings | Stores › Configuration › Magento Expert › Username Login (3 options) |
| Per store view settings | Yes |
| API | No custom endpoints (uses Magento's standard APIs) |
| CLI commands | mage2expert:username:generate |
| PHP | 8.1, 8.2, 8.3, 8.4, 8.5 |
Installation
After purchasing on the Adobe Commerce Marketplace, install it with Composer using your Marketplace access keys:
composer require mage2expert/module-username
bin/magento module:enable Mage2Expert_Username
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy -f
bin/magento cache:flush
Skip setup:di:compile and static-content:deploy if your store runs in developer mode.
Configuration reference
All 3 options under Stores › Configuration › Magento Expert › Username Login, grouped as they appear in the admin.
General Settings 1
| Setting | Description |
|---|---|
| Enable Username Login |
Username Generation (CLI Command) 2
| Setting | Description |
|---|---|
| Generation Pattern | Pattern used when generating usernames for existing customers via CLI. |
| Custom Prefix | Used only when "Custom Prefix + ID" pattern is selected (e.g. "user_" produces user_123). |
Developer reference
Command line
bin/magento mage2expert:username:generate
Frequently asked questions
How much does Username cost?
Which Magento and PHP versions are supported?
Where do I configure Username?
Can I switch it off without uninstalling it?
Can the settings differ per store view?
Can it be customised for my store?
More Customer & Support
Related extensions
Helpdesk
A complete in-store support ticketing system with departments, agent routing and automatic ticket closing.
Google One Tap Sign In
Let shoppers sign in or register with a single tap of their Google account.
Force Login
Require customers to log in before browsing the store or selected pages, for B2B and private stores.
Have a Magento project in mind?
Tell me about your store and what you need. I reply to every enquiry within one business day.
Adobe Certified Expert
Adobe Commerce Developer certification, verified on Credly.
15+ years of Magento
From Magento 1 to Magento 2.4.x, Adobe Commerce and Hyvä.
62 Marketplace extensions
Each one reviewed and approved by Adobe.




