Automatically login based on whitelisted IP, basic auth username or URL keys
Automatically login based on whitelisted IP, basic auth username or URL keys.
You can install Autologin via the plugin store, or through Composer.
To install Autologin, navigate to the Plugin Store section of your Craft control panel, search for
Autologin, and click the Try button.
You can also add the package to your project using Composer and the command line.
- Open your terminal and go to your Craft project:
- Then tell Composer to require the plugin, and Craft to install it:
composer require verbb/autologin && php craft plugin/install autologin
The plugin is configured in the
config/ directory in a file you create called
autologin.php. What follows is an example of what it might contain.
<?php return [ // Enable the Autologin plugin 'enabled' => true, // A list of Craft usernames/emails mapped to IPs 'ipWhitelist' => [ 'craftUsername' => [ '126.96.36.199', '188.8.131.52', ], ], // A list of Craft usernames/emails mapped to basic auth usernames 'basicAuth' => [ 'craftUserName1' => 'basicAuthUsername', 'craftUserName2' => 'basicAuthUsername2', ], // A list of Craft usernames/emails mapped to url keys 'urlKeys' => [ 'craftUserName' => 'BepmD8GQBZpaFpXQ', ], // Redirect to this url after logging in automatically 'redirectUrl' => '', ];
You can provide your users with a url that automatically logs them in. To set this up, you need a pair of username => password in the
After setting that up, you can login by going to
If you want to redirect to the control panel dashboard, add cp=true to the url:
Originally created by the team at Superbig.
Autologin is licensed under the MIT license, meaning it will always be free and open source – we love free stuff! If you'd like to show your support to the plugin regardless, Sponsor development.