PHPackages                             grazulex/laravel-oneclicklogin - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. grazulex/laravel-oneclicklogin

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

grazulex/laravel-oneclicklogin
==============================

Passwordless authentication via magic links for Laravel applications - secure, single-use, time-limited URLs for seamless user login.

v1.0.0(8mo ago)833MITPHPPHP ^8.3CI passing

Since Aug 25Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/Grazulex/laravel-oneclicklogin)[ Packagist](https://packagist.org/packages/grazulex/laravel-oneclicklogin)[ Docs](https://github.com/grazulex/laravel-oneclicklogin)[ Fund](https://paypal.me/strauven)[ GitHub Sponsors](https://github.com/Grazulex)[ RSS](/packages/grazulex-laravel-oneclicklogin/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (10)Versions (2)Used By (0)

Laravel OneClickLogin
=====================

[](#laravel-oneclicklogin)

 [![Laravel OneClickLogin](https://raw.githubusercontent.com/Grazulex/laravel-oneclicklogin/main/new_logo.png)](https://raw.githubusercontent.com/Grazulex/laravel-oneclicklogin/main/new_logo.png)**Passwordless authentication via magic links for Laravel applications - secure, single-use, time-limited URLs for seamless user login.**

*A powerful Laravel package for creating passwordless authentication with comprehensive security features and audit trails.*

[![Latest Version](https://camo.githubusercontent.com/4dac6bd53af6afc133f05e71d985a71121e8fbc0e8b4b751f978e76fe5f29fe2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6772617a756c65782f6c61726176656c2d6f6e65636c69636b6c6f67696e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/grazulex/laravel-oneclicklogin) [![Total Downloads](https://camo.githubusercontent.com/72e7fce02c1687405526f734c227164314cf1fe3608fd791bd4ee6fc62ae65eb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6772617a756c65782f6c61726176656c2d6f6e65636c69636b6c6f67696e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/grazulex/laravel-oneclicklogin) [![License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://github.com/Grazulex/laravel-oneclicklogin/blob/main/LICENSE.md) [![PHP Version](https://camo.githubusercontent.com/e4fa9a2e9bf493f2e2579e8f3d9bb4ae9d39b12669c705d5631f5e16ece9a84e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d382e332532422d626c75652e7376673f7374796c653d666c61742d737175617265)](https://php.net/) [![Laravel Version](https://camo.githubusercontent.com/4cf23fa8e9ed2da3aa0e145ab43ee6b952292254ed0dc1abf31cf969fb5a8255/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c61726176656c2d31312e3025324225323025374325323031322e302532422d7265642e7376673f7374796c653d666c61742d737175617265)](https://laravel.com/) [![Tests](https://camo.githubusercontent.com/abd2bc0282acef694d68bc539fc828782b60ed31e81601c61b1a82df5c9ed576/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6772617a756c65782f6c61726176656c2d6f6e65636c69636b6c6f67696e2f74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/grazulex/laravel-oneclicklogin/actions) [![Code Style](https://camo.githubusercontent.com/60b3efeca23027d8653045a2586d812a8c1d2f26be501cf2b0f941bade567d2c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f64652532307374796c652d70696e742d6f72616e67652e7376673f7374796c653d666c61742d737175617265)](https://github.com/laravel/pint)

---

🚀 Overview
----------

[](#-overview)

Laravel OneClickLogin is a comprehensive package for implementing passwordless authentication in your Laravel applications. Perfect for creating secure, time-limited magic links that provide seamless user login without passwords, with complete audit trails and advanced security features.

✨ Key Features
--------------

[](#-key-features)

- 🔐 **Passwordless Authentication** - Replace or complement password-based login
- ⏰ **Time-Limited Access** - Set expiration dates and usage limits
- 🔒 **Security-by-Default** - Signed, hashed tokens with short expirations
- 🚫 **Rate Limiting** - Per-email and per-IP rate limiting to prevent abuse
- 🌐 **IP &amp; Device Binding** - Optional IP address and device fingerprint binding
- 🔏 **Signed URLs** - Laravel signed route integration for additional security
- 🔥 **Single-Use Links** - Magic links that expire after first successful use
- 📊 **Comprehensive Auditing** - Track access patterns, IPs, and timestamps
- 🛡️ **Advanced Security** - OTP step-up authentication for suspicious devices
- 🎭 **MultiPersona Integration** - Include persona/tenant/role context in links
- 📧 **Flexible Delivery** - Support for email, SMS, and custom notification channels
- 📋 **Management API** - Revoke and extend links programmatically
- 🎨 **CLI Commands** - Full Artisan command support
- � **Observability** - Built-in logging and metrics integration
- 🔗 **ShareLink Integration** - Optional delivery layer with analytics and audit trails
- 🧪 **Test-Friendly** - Comprehensive test coverage with easy mocking

📦 Installation
--------------

[](#-installation)

Install the package via Composer:

```
composer require grazulex/laravel-oneclicklogin
```

Publish and run the migrations:

```
php artisan vendor:publish --tag="oneclicklogin-migrations"
php artisan migrate
```

Optionally, publish the configuration file:

```
php artisan vendor:publish --tag="oneclicklogin-config"
```

> 💡 **Auto-Discovery**: The service provider will be automatically registered thanks to Laravel's package auto-discovery.

⚡ Quick Start
-------------

[](#-quick-start)

> 📖 **Need more examples?** Check out our [Examples Gallery](https://github.com/Grazulex/laravel-oneclicklogin/wiki/Examples-SPA) for e-commerce, SPA, and multi-tenant scenarios.

### 🚀 Basic Usage

[](#-basic-usage)

```
use Grazulex\OneClickLogin\Facades\OneClickLogin;

// Send a magic link with expiration
$link = OneClickLogin::to($user)
    ->via('mail')
    ->expireIn(15) // 15 minutes
    ->withContext(['redirect' => '/dashboard'])
    ->send();

echo $link->getSignedUrl(); // https://yourapp.com/login/magic?token=abc123xyz
```

### 📧 Email Magic Links

[](#-email-magic-links)

```
// Send via email with custom context
OneClickLogin::to($user)
    ->via('mail')
    ->expireIn(30) // 30 minutes
    ->maxUses(1)
    ->withContext([
        'redirect' => '/profile',
        'remember' => true
    ])
    ->send();
```

### 📱 SMS Magic Links

[](#-sms-magic-links)

```
// Send via SMS
OneClickLogin::to($user)
    ->via('sms')
    ->expireIn(10) // 10 minutes
    ->withContext(['redirect' => '/mobile-dashboard'])
    ->send();
```

### 🎭 MultiPersona Integration

[](#-multipersona-integration)

```
// Magic link with persona context
OneClickLogin::to($user)
    ->via('mail')
    ->expireIn(30)
    ->withContext([
        'persona' => 'client',
        'tenant'  => 123,
        'role'    => 'admin',
        'redirect'=> '/admin/dashboard',
        'remember'=> true
    ])
    ->bindIp() // Optional IP binding
    ->bindDevice($request) // Optional device binding
    ->send();
```

### 🔥 Advanced Security Features

[](#-advanced-security-features)

```
// Secure magic link with IP restrictions and OTP step-up
OneClickLogin::to($user)
    ->via('mail')
    ->expireIn(15)
    ->bindIp() // Bind to current IP
    ->bindDevice($request) // Bind to device fingerprint
    ->withContext([
        'redirect' => '/secure-area',
        'otp_required' => true // Require OTP for suspicious access
    ])
    ->send();

// Create without sending for custom delivery
$link = OneClickLogin::create($user, [
    'ttl' => 30,
    'context' => ['redirect' => '/billing'],
]);
```

🔧 Requirements
--------------

[](#-requirements)

• PHP 8.3+ • Laravel 11.0+ | 12.0+

> 📋 **Compatibility Matrix**: See our [Installation Guide](https://github.com/Grazulex/laravel-oneclicklogin/wiki/Installation) for detailed Laravel/PHP compatibility.

📚 Complete Documentation
------------------------

[](#-complete-documentation)

For comprehensive documentation, examples, and advanced usage guides, visit our Wiki:

### 📖 [👉 Laravel OneClickLogin Wiki](https://github.com/Grazulex/laravel-oneclicklogin/wiki)

[](#--laravel-oneclicklogin-wiki)

The wiki includes:

- 🚀 [Installation &amp; Setup](https://github.com/Grazulex/laravel-oneclicklogin/wiki/Installation)
- ⚙️ [Configuration](https://github.com/Grazulex/laravel-oneclicklogin/wiki/Configuration)
- 🎯 [Quick Start Guide](https://github.com/Grazulex/laravel-oneclicklogin/wiki/Quick-Start)
- 🔗 [Link Creation Options](https://github.com/Grazulex/laravel-oneclicklogin/wiki/Link-Creation-Options)
- 📋 [API Reference](https://github.com/Grazulex/laravel-oneclicklogin/wiki/API-Reference)
- ⌨️ [Console Commands](https://github.com/Grazulex/laravel-oneclicklogin/wiki/Console-Commands)
- � [Examples](https://github.com/Grazulex/laravel-oneclicklogin/wiki/Examples-SPA)
- 🔧 [Troubleshooting](https://github.com/Grazulex/laravel-oneclicklogin/wiki/Troubleshooting)
- ❓ [FAQ](https://github.com/Grazulex/laravel-oneclicklogin/wiki/FAQ)

🎨 Artisan Commands
------------------

[](#-artisan-commands)

Laravel OneClickLogin includes powerful CLI commands for managing your magic links:

```
# Send a magic link
php artisan oneclicklogin:send user@example.com --via=mail --ttl=15

# List all magic links
php artisan oneclicklogin:list --active --expired

# Revoke a specific link
php artisan oneclicklogin:revoke abc123xyz

# Clean up expired links
php artisan oneclicklogin:prune --days=7

# Test magic link generation
php artisan oneclicklogin:test user@example.com
```

🔧 Configuration
---------------

[](#-configuration)

The package comes with sensible defaults, but you can customize everything:

```
// config/oneclicklogin.php
return [
    'ttl_minutes' => 15,
    'max_uses' => 1,
    'guard' => 'web',

    'security' => [
        'ip_binding' => false,
        'device_binding' => false,
        'enable_otp_step_up' => false,
        'hash_algorithm' => 'sha256',
        'signed_urls' => true,
    ],

    'rate_limit' => [
        'issue_per_email_per_hour' => 5,
        'consume_per_ip_per_min' => 20,
    ],

    'multi_persona' => [
        'enabled' => true,
        'keys' => ['persona', 'tenant', 'role'],
    ],
];
```

🔧 Troubleshooting
-----------------

[](#-troubleshooting)

### Common Issue: API vs CLI Discrepancy

[](#common-issue-api-vs-cli-discrepancy)

If `OneClickLogin::for()->generate()` fails but CLI commands work, this is typically an **environment setup issue**, not a package bug:

```
# Quick fix - ensure clean environment
php artisan migrate:fresh
php artisan cache:clear
php artisan config:clear

# Then test
php artisan tinker
>>> OneClickLogin::for('test@example.com')->generate();
```

**For testing, always use `RefreshDatabase`:**

```
use Illuminate\Foundation\Testing\RefreshDatabase;

class YourTest extends TestCase {
    use RefreshDatabase; // ← Prevents environment issues
}
```

👉 **Full troubleshooting guide**: [Wiki Troubleshooting](https://github.com/Grazulex/laravel-oneclicklogin/wiki/Troubleshooting)

🧪 Testing
---------

[](#-testing)

```
composer test
```

🤝 Contributing
--------------

[](#-contributing)

Please see the [Contributing Guide](CONTRIBUTING.md) for details.

🔒 Security
----------

[](#-security)

If you discover any security-related issues, please email  instead of using the issue tracker.

📝 Changelog
-----------

[](#-changelog)

Please see the [Changelog](https://github.com/Grazulex/laravel-oneclicklogin/wiki/Home) for more information on what has changed recently.

📄 License
---------

[](#-license)

The MIT License (MIT). Please see [License File](https://github.com/Grazulex/laravel-oneclicklogin/blob/main/LICENSE.md) for more information.

👥 Credits
---------

[](#-credits)

• [Jean-Marc Strauven](https://github.com/Grazulex)• [All Contributors](https://github.com/Grazulex/laravel-oneclicklogin/contributors)

💬 Support
---------

[](#-support)

• 🐛 [Report Issues](https://github.com/Grazulex/laravel-oneclicklogin/issues)• 💬 [Discussions](https://github.com/Grazulex/laravel-oneclicklogin/discussions)• 📖 [Documentation](https://github.com/Grazulex/laravel-oneclicklogin/wiki)

---

**Laravel OneClickLogin** - Passwordless authentication for Laravel applications with comprehensive security features and audit trails.

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance59

Moderate activity, may be stable

Popularity11

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

260d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/888105bd54b6b7f7905523a16a1d08eebc2e5d39b19a4c174b5961bb4d52929b?d=identicon)[Grazulex](/maintainers/Grazulex)

---

Top Contributors

[![Grazulex](https://avatars.githubusercontent.com/u/4521546?v=4)](https://github.com/Grazulex "Grazulex (15 commits)")[![ylynfatt](https://avatars.githubusercontent.com/u/19831?v=4)](https://github.com/ylynfatt "ylynfatt (2 commits)")

---

Tags

laravelloginphpsecuritylaravelAuthenticationtokensecurephp8Passwordlessmagic-linkoneclicklogin

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/grazulex-laravel-oneclicklogin/health.svg)

```
[![Health](https://phpackages.com/badges/grazulex-laravel-oneclicklogin/health.svg)](https://phpackages.com/packages/grazulex-laravel-oneclicklogin)
```

###  Alternatives

[tymon/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

11.5k49.1M350](/packages/tymon-jwt-auth)[php-open-source-saver/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

8359.8M53](/packages/php-open-source-saver-jwt-auth)[auth0/login

Auth0 Laravel SDK. Straight-forward and tested methods for implementing authentication, and accessing Auth0's Management API endpoints.

2745.0M3](/packages/auth0-login)[rinvex/laravel-authy

Rinvex Authy is a simple wrapper for Authy TOTP, the best rated Two-Factor Authentication service for consumers, simplest 2fa Rest API for developers and a strong authentication platform for the enterprise.

3376.7k1](/packages/rinvex-laravel-authy)[alajusticia/laravel-logins

Session management in Laravel apps, user notifications on new access, support for multiple separate remember tokens, IP geolocation, User-Agent parser

2011.0k](/packages/alajusticia-laravel-logins)[acidjazz/humble

passwordless authentication and detailed sessioning for laravel

15136.5k](/packages/acidjazz-humble)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
