Authorize strategy for Twitter authentication.
- Install Authorize into your application to use this Strategy.
Add the following to your composer.json
"require": {
...
"soapbox/authorize-twitter": "dev-master",
...
}
Add the following to your app.php
, note this will be removed in future
versions since it couples us with Laravel, and it isn't required for the library
to function
'providers' => array(
...
"SoapBox\AuthorizeTwitter\AuthorizeTwitterServiceProvider",
...
)
use SoapBox\Authroize\Authenticator;
use SoapBox\Authorize\Exceptions\InvalidStrategyException;
...
$settings = [
...
];
$strategy = new Authenticator('twitter', $settings);
$user = $strategy->authenticate($parameters);
use SoapBox\Authroize\Authenticator;
use SoapBox\Authorize\Exceptions\InvalidStrategyException;
...
$settings = [
...
];
$strategy = new Authenticator('twitter', $settings);
$user = $strategy->endpoint();