A WordPress plugin that implements WebAuthn/Passkeys authentication for WordPress sites. Login without username and password - the most secure way to login to your WordPress site.
WP Passkeys allows users to register and authenticate using passkeys instead of traditional username and password combinations. Passkeys are based on the WebAuthn standard, which provides a more secure and convenient authentication method that is resistant to phishing and credential theft.
- Passkey Authentication: Allow users to log in using passkeys (biometrics, security keys, etc.)
- Passkey Registration: Enable users to register passkeys during account creation or in their profile
- Device Management: Users can manage their registered passkeys in their profile
- Admin Settings: Configure passkey behavior and settings
- Fallback Authentication: Traditional login still available when needed
- Security Tracking: Track passkey usage and devices for security monitoring
- WordPress 5.9+
- PHP 8.2+
- HTTPS enabled (WebAuthn requires a secure context)
- Modern browser with WebAuthn support
-
Clone the repository:
git clone https://github.com/your-username/wp-passkeys.git
-
Install dependencies:
composer install yarn install
-
Build assets:
yarn build
-
Upload the plugin to your WordPress site or install it directly in the plugins directory.
-
Activate the plugin through the WordPress admin interface.
- Go to Settings > WP Passkeys in your WordPress admin.
- Configure the plugin settings according to your needs.
- Save changes.
- Registration: During registration, users will be prompted to create a passkey.
- Login: On the login page, users can click "Login with Passkey" to authenticate.
- Managing Passkeys: Users can manage their passkeys in their WordPress profile.
- Configure plugin settings in Settings > WP Passkeys.
- Monitor passkey usage and security in the admin dashboard.
- Assist users with passkey management if needed.
The project includes Docker configuration for local development:
-
Start the Docker environment:
docker-compose up -d
-
Install dependencies:
composer install yarn install
-
Watch for changes during development:
yarn watch
-
includes/
: PHP classesPasskeysPlugin.php
: Main plugin classServiceProvider.php
: Dependency injection setupCeremonies/
: WebAuthn registration and authenticationCredentials/
: Credential managementRestApi/
: REST API endpointsAdmin/
: Admin settingsForm/
: Login form modifications
-
assets/
: Frontend assetsjs/
: JavaScript filesauthentication/
: Authentication implementationregistration/
: Registration implementationform/
: Form handlingadmin/
: Admin panel functionality
css/
: Stylesheets
- JavaScript/TypeScript is bundled using Parcel
- SCSS is compiled to CSS using Parcel
- PHP follows PSR-4 autoloading
Run PHP tests:
composer phpunit
Check PHP code quality:
composer phpcs
Check TypeScript:
yarn check
The plugin provides the following REST API endpoints:
GET /wp-json/wp-passkeys/register/options
: Get registration optionsPOST /wp-json/wp-passkeys/register/verify
: Verify registrationGET /wp-json/wp-passkeys/authenticator/options
: Get authentication optionsPOST /wp-json/wp-passkeys/authenticator/verify
: Verify authenticationGET /wp-json/wp-passkeys/creds/user
: Get user credentialsPOST /wp-json/wp-passkeys/creds/user
: Set user credentialsDELETE /wp-json/wp-passkeys/creds/user/remove/{id}
: Remove user credential
- PHP 8.2+ with PSR-4 autoloading
- League Container for dependency injection
- Symfony Serializer for data serialization
- Web-Auth/WebAuthn-Lib for WebAuthn implementation
- Custom database table for credential storage
- TypeScript for type safety
- SimpleWebAuthn/Browser for client-side WebAuthn implementation
- Parcel for bundling
- Object-oriented approach with classes for Authentication and Registration
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-feature
- Commit your changes:
git commit -am 'Add new feature'
- Push to the branch:
git push origin feature/my-feature
- Submit a pull request
This project is licensed under the GPL2 License - see the LICENSE file for details.
- Web-Auth/WebAuthn-Lib for the PHP WebAuthn implementation
- SimpleWebAuthn for the JavaScript WebAuthn implementation