Add the following to your composer.json
"require": {
"optios/authenticator": "dev-master"
},
"repositories": [
{
"type": "vcs",
"url": "[email protected]:optiosteam/optios-authenticator.git"
}
]
$provider = new \OptiosAuthenticator\Provider\MemoryProvider();
$authenticator = new \OptiosAuthenticator\Authenticator();
$bearerToken = $request->headers->get('X-Auth-Token');
try {
$token = $authenticator->authenticate($bearerToken);
} catch (\OptiosAuthenticator\AuthenticationException $exception) {
// Handle authentication failure
}
Possible Providers:
- MemoryProvider for development purposes
- TODO: Add provider for production
bin/phpunit