roaresearch/yii2-cognito

Installs: 4

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:yii2-extension

dev-main 2023-06-18 18:12 UTC

This package is auto-updated.

Last update: 2024-11-18 21:00:50 UTC


README

This Yii2 extension provides a Cognito Authenticator.

Requirements

Installation

To install the package, you need to install composer and then run the following command:

Usage

Add Authenticator to the authMethods section of your authenticator component:

'authenticator' => [
    'class' => \yii\filters\CompositeAuth::class,
    'oauth2Module' => $this->getOauth2Module(),
    'authMethods' => [
        [
            'class' => \roaresearch\yii2\cognito\Authenticator::class,
            'userModelClass' => 'common\models\User',
            'userPoolId' => '<userPoolId>',
            'region' => '<region>',
            'clientIds' => ['clientIds'],
        ],
        [
            'class' => \yii\filters\auth\HttpBearerAuth::class,
        ],
        [
            'class' => \yii\filters\auth\QueryParamAuth::class,
            // !Important, GET request parameter to get the token.
            'tokenParam' => 'accessToken',
        ],
    ],
]

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Considering SemVer for versioning rules 9, 10 and 11 talk about pre-releases, they will not be used within the ROAResearch.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details