PHP Digest Auth library Usage $auth = new \Rakshazi\Digestauth; $auth->setUsers(array('admin' => 'password'))->setRealm("It's optional")->enable(); Installation php composer.phar require rakshazi/digestauth:dev-master