Auth0
Auth0 is user authentication and management service. You can use it for custom sites so you don't have to manage users. It allows you to provide username/password and social media authentication without having to support each yourself.
To install magium/auth0 issue the following composer command:
composer require magium/auth0
Logging in via Username and Password
/* * Make sure you configure your twitter account in the file /configuration/Magium/Auth0/Identities/Username.php * $this->username = 'username'; * $this->password = 'password'; */ class UsernameTest extends Magium\AbstractTestCase { public function testLogin() { $this->commandOpen('http://localhost/'); $action = $this->getAction(\Magium\Auth0\Actions\Login::ACTION); $action->setIdentity($this->getIdentity(Username::IDENTITY)); $action->execute(); } }
Logging in via Twitter
/* * Make sure you configure your twitter account in the file /configuration/Magium/Twitter/Identities/Twitter.php * $this->username = 'username'; * $this->password = 'password'; */ class TwitterTest extends Magium\AbstractTestCase { public function testLogin() { $this->commandOpen('http://localhost/'); $action = $this->getAction(\Magium\Auth0\Actions\Login::ACTION); /* @var $action Login */ $action->setIdentity($this->getIdentity(Twitter::IDENTITY)); $action->execute(); } }