PHPackages                             iwouldrathercode/cognito - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. iwouldrathercode/cognito

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

iwouldrathercode/cognito
========================

Simple laravel package to work with aws-php-sdk and amazon cognito

0.0.2(3y ago)06MITPHPPHP ^8.1

Since Oct 9Pushed 3y ago1 watchersCompare

[ Source](https://github.com/iwouldrathercode/cognito)[ Packagist](https://packagist.org/packages/iwouldrathercode/cognito)[ Docs](https://github.com/iwouldrathercode/cognito)[ RSS](/packages/iwouldrathercode-cognito/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (14)Versions (3)Used By (0)

iwouldrathercode/cognito
========================

[](#iwouldrathercodecognito)

[![Latest Version on Packagist](https://camo.githubusercontent.com/869b97a6494e64c88b8498e4b7532afed5b0152b8ee62460397cdf7d361b3264/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f69776f756c64726174686572636f64652f636f676e69746f2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/iwouldrathercode/cognito)[![GitHub Tests Action Status](https://camo.githubusercontent.com/384ced79302caa5f45f3cae23f44bcbde598f76d35aef52a2fb34f263cd499b5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f69776f756c64726174686572636f64652f636f676e69746f2f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/iwouldrathercode/cognito/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/66fe34ef806b113b0a19937682feba16a18b0381b744d4fa1a61390e5dad95cb/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f69776f756c64726174686572636f64652f636f676e69746f2f466978253230504850253230636f64652532307374796c652532306973737565733f6c6162656c3d636f64652532307374796c65)](https://github.com/iwouldrathercode/cognito/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/7e066939a5d8edd4cde0f98e205a3866d0e4722cbde5f7f7ddd14148deafdbf1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f69776f756c64726174686572636f64652f636f676e69746f2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/iwouldrathercode/cognito)

Simple laravel package to work with aws-php-sdk and amazon cognito. Once installed it can generate api routes to work with cognito apis and generate and validate jwt tokens

Installation &amp; Setup
------------------------

[](#installation--setup)

### Step 1

[](#step-1)

You can install the package via composer:

```
composer require iwouldrathercode/cognito
```

### Step 2

[](#step-2)

Run the setup command to install dependencies and link the storage folder to public folder

```
php artisan cognito:setup
```

### Step 3

[](#step-3)

Run the install command to publish the config files and migrations

```
php artisan cognito:install
```

### Step 4

[](#step-4)

Execute the migrations. This will update the users table and since passwords are no longer managed by laravel, this will also delete the password\_resets table

```
php artisan migrate
```

### Step 5

[](#step-5)

Update the config/auth.php with default guard as `api`

```
    ..
    ..

    'defaults' => [
        'guard' => 'api',
        'passwords' => 'users',
    ],
    ..
    ..
```

### Step 6

[](#step-6)

Update the config/auth.php, guards array with config of `api` using 'cognito' as driver

```
    ..
    ..
    'guards' => [
        ..
        ..

        'api' => [
            'driver' => 'cognito',
            'provider' => 'users'
        ]
    ],
    ..
    ..
```

### Step 7

[](#step-7)

Ensure the env variables of the cognito UserPool and ClientID are at .env this will affect `congig/cognito.php` config file

```
AWS_COGNITO_USER_POOL_ID=
AWS_COGNITO_CLIENT_ID=
AWS_DEFAULT_REGION=
```

Usage
-----

[](#usage)

This package will create /api routes to manage authentication

```
POST -> api/confirm-forgot-password -> confirm-forgot-password ›
Iwouldrathercode\Cognito\Http\Controllers\SelfServiceController@confirmForgotPassword

POST -> api/forgot-password -> forgot-password › Iwouldrathercode\Cognito\Http\Controllers\SelfServiceController@forgotPassword

POST -> api/login -> signin ›
Iwouldrathercode\Cognito\Http\Controllers\LoginController@login

POST -> api/register -> signup ›
Iwouldrathercode\Cognito\Http\Controllers\RegisterController@register

POST -> api/verify -> verify ›
Iwouldrathercode\Cognito\Http\Controllers\EmailVerificationController@verify

POST -> api/logout -> signout ›
Iwouldrathercode\Cognito\Http\Controllers\LoginController@logout
```

TODO
----

[](#todo)

- Create valid Unit Test cases

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Credits
-------

[](#credits)

- [Shankar](https://github.com/psgganesh)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

1317d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/889a2d844f502e7c17e55584c90fc02fb54d0850bd51cfc2bc7194eef2894523?d=identicon)[psgganesh](/maintainers/psgganesh)

---

Top Contributors

[![psgganesh](https://avatars.githubusercontent.com/u/2221525?v=4)](https://github.com/psgganesh "psgganesh (18 commits)")

---

Tags

amazon-cognitoapiauthenticationawslaravelpackagelaravelCognitoiwouldrathercode

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/iwouldrathercode-cognito/health.svg)

```
[![Health](https://phpackages.com/badges/iwouldrathercode-cognito/health.svg)](https://phpackages.com/packages/iwouldrathercode-cognito)
```

###  Alternatives

[spatie/laravel-permission

Permission handling for Laravel 12 and up

12.9k89.8M1.0k](/packages/spatie-laravel-permission)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[jeffgreco13/filament-breezy

A custom package for Filament with login flow, profile and teams support.

1.0k1.7M41](/packages/jeffgreco13-filament-breezy)[spatie/laravel-login-link

Quickly login to your local environment

4381.2M1](/packages/spatie-laravel-login-link)[ryangjchandler/laravel-cloudflare-turnstile

A simple package to help integrate Cloudflare Turnstile.

438896.6k2](/packages/ryangjchandler-laravel-cloudflare-turnstile)[spatie/laravel-passkeys

Use passkeys in your Laravel app

444494.4k16](/packages/spatie-laravel-passkeys)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
