dvsa / authentication-cognito
A wrapper around the AWS SDK (Cognito)
Installs: 14 274
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 7
Forks: 1
Open Issues: 0
Requires
- php: ^8.0
- ext-json: *
- aws/aws-sdk-php: ^3.288.1
- dvsa/contracts: ^1.1
- firebase/php-jwt: ^6.3
- guzzlehttp/guzzle: ^7.4.5
- guzzlehttp/psr7: ^2.4.5
- illuminate/collections: ^8.0 || ^11.0
- league/oauth2-client: ^2.6
- psr/cache: ^1.0 || ^3.0
- psr/http-client: ^1.0
- psr/http-factory: ^1.0
Requires (Dev)
- bamarni/composer-bin-plugin: ^1.4
- phpunit/phpunit: ^9.5.4
- dev-main
- v3.1.0
- v3.0.0
- v2.0.0
- v1.3.3
- v1.3.2
- v1.3.1
- v1.3.0
- v1.2.1
- v1.2.0
- v1.1.0
- v1.0.2
- v1.0.1
- v1.0.0
- dev-bump/firebasejwt
- dev-feature-VOL-2447
- dev-feature/remove-need-for-7.2-tests
- dev-add-ability-for-custom-resource-owners
- dev-inherit-docblocks-from-contracts
- dev-update-getId-returned-attribute
- dev-feature-BL-12287-support-azure-ad
- dev-brainstorm-branch
This package is auto-updated.
Last update: 2024-11-15 16:24:28 UTC
README
A thin authentication wrapper around the aws-sdk, focusing on the Cognito endpoints.
Installing
The recommended way to install is through Composer.
composer require dvsa/authentication-cognito
Usage
<?php use Aws\CognitoIdentityProvider\CognitoIdentityProviderClient; use Aws\Credentials\Credentials; use Dvsa\Authentication\Cognito\Client; # Variables below must be replaced by their respective values. $accessKey = 'AWS_ACCESS_KEY'; $secret = 'AWS_SECRET'; $clientId = 'CLIENT_ID'; $clientSecret = 'CLIENT_SECRET'; $poolId = 'POOL_ID'; # https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-Aws.Credentials.Credentials.html#___construct $awsCredentials = new Credentials($accessKey, $secret); # https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-Aws.AwsClient.html#___construct $awsClient = new CognitoIdentityProviderClient([ 'credentials' => $awsCredentials, 'version' => '2016-04-18', 'region' => 'eu-west-2' ]); return new Client( $awsClient, $clientId, $clientSecret, $poolId );
Contributing
Please refer to our Contribution Guide and Contributor Code of Conduct.