A Laravel wrapper for hobbii/cognito-client
hobbii/laravel-cognito-client is a Laravel package for a laravel wrapper for hobbii/cognito-client.
It currently has 0 GitHub stars and 2.450 downloads on Packagist (latest version 1.0.2).
Install it with composer require hobbii/laravel-cognito-client.
Discover more Laravel packages by hobbii
or browse all Laravel packages to compare alternatives.
Last updated
A public composer pacakge, adding a Cognito Client for Laravel using hobbii/cognito-client
composer require hobbii/laravel-cognito-client
Add the following environment variables:
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=
COGNITO_APP_CLIENT_ID=
COGNITO_APP_CLIENT_SECRET=
COGNITO_USER_POOL_ID=
Use the hobbii-driver with socialite:
<?php
use Illuminate\Http\Request;
use Hobbii\LaravelCognitoClient\Facades\Cognito;
class AuthController extends Controller
{
public function login(Request $request)
{
$authSession = Cognito::authenticate($request->email, $request->password);
if ($authSession->success()) {
return redirect()->route('dashboard');
}
return back()->withErrors([
'email' => 'Invalid email or password!'
]);
}
}
Publish the configuration file to customise settings, by running
php artisan vendor:publish --provider="Hobbii\LaravelCognitoClient\CognitoClientServiceProvider" --tag=config
Customise the configurations in config/hobbii-cognito.php.
You can find tests in the /tests folder, and you can run them by using ./vendor/bin/phpunit.
You can run PHPStan, by executing ./vendor/bin/phpstan analyse
All contents of this package are licensed under the MIT license.