ellaisys / aws-cognito
Laravel Authentication using AWS Cognito (Web and API)
Requires
- php: ^7.4|^8.0
- ext-gmp: *
- aws/aws-sdk-php: ^3.380
- firebase/php-jwt: ^7.0
- guzzlehttp/guzzle: ^7.10
Requires (Dev)
- phpunit/phpunit: >=9.0
This package is auto-updated.
Last update: 2026-08-05 18:51:36 UTC
README
Laravel Authentication using AWS Cognito
Note
Last Updated: 2026-07-31
Contents
- Introduction
- Features
- Architecture and Design
- Installation
- Quick Start & Configurations
- References
- Usage
- Code Quality
- Changelog
- Security
- Roadmap
- FAQs
- Credits & Contributors
- Support Us
- License
- Disclaimer
Introduction
This package provides native integration between Laravel's authentication system and Amazon Cognito. It supports session-based authentication for web applications, token-based authentication for APIs, Multi-Factor Authentication (MFA), SRP authentication, Passkeys (FIDO2/WebAuthn), and Device Authentication while allowing developers to continue using Laravel's familiar authentication features.
It integrates AWS Cognito into Laravel's authentication ecosystem while preserving Laravel's native authentication experience.
This is built on top of the AWS Cognito SDK for PHP, to provide a simple and easy-to-use experience for interacting with the AWS Cognito service. The package provides a set of traits that can be used in your Laravel controllers to handle all the authentication-related features.
Demo Application & Code
A complete demo application is available that demonstrates the package in a real Laravel application. It can be used as a reference implementation or as a starting point for your own projects.
The demo application code is available on the GitHub and can be used as a reference for your own application.
Compatibility
| PHP Support | Laravel Support | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
Features
-
Authentication
-
Supports User Invitation & Registration ✔️ User Verification ✔️ User Login & Logout ✔️ Forgot Password ✔️ Password Reset ✔️ Session Authentication ✔️ API Authentication ✔️ Laravel Guards ✔️ More -
SRP New Feature
-
Remembered Devices New Feature
-
-
Security
- Multi-Factor Authentication (MFA) Updated
- FIDO2 Security Keys (Passkeys) Updated
-
Laravel
Architecture and Design
The following diagram illustrates the high level architecture and design of this package, highlighting its integration with Laravel's authentication system and AWS Cognito services.
Installation
This package is available via Packagist and can be installed using composer.
composer require ellaisys/aws-cognito
Code Quality
This project follows secure coding and quality assurance practices throughout its development lifecycle. Automated static analysis is performed using SonarCloud to identify potential bugs, vulnerabilities, maintainability issues, and code smells before changes are merged.
In addition to automated analysis, all contributions are reviewed before being merged to help maintain the quality, reliability, and security of the project.
Changelog
For a complete history of changes, improvements, bug fixes, and new features, please refer to the CHANGELOG.md.
Security
The security of this project and its users is important to us. If you discover or suspect a security vulnerability, please follow our responsible disclosure process described in SECURITY.md.
We kindly ask that you do not report security vulnerabilities through public GitHub issues.
Roadmap
Our development roadmap, planned features, and future enhancements are maintained on the project's GitHub Projects and Wiki.
Credits & Contributors
This project has been inspired by the work of the open-source community. We are grateful to the developers and maintainers whose ideas, discussions, libraries, and code have helped influence the design and implementation of this package.
We would like to acknowledge the following projects and organizations for their inspiration, technical references, or contributions. Portions of this project were adapted from the following open-source projects in accordance with their respective licenses:
- Pod-Point – https://github.com/Pod-Point
- black-bits/laravel-cognito-auth – https://github.com/black-bits/laravel-cognito-auth
- tymondesigns/jwt-auth – https://github.com/tymondesigns/jwt-auth
Special thanks to everyone who has contributed their time, expertise, and feedback to help improve this project.
- EllaiSys Team – https://github.com/ellaisys
- Project Contributors – https://github.com/ellaisys/aws-cognito/graphs/contributors
Contribute
Open source thrives because of its community. Whether you're fixing bugs, improving documentation, reviewing code, suggesting new features, or helping other users, every contribution is valued and appreciated.
If you'd like to get involved, explore the contribution badges below to find ways you can help.
Support Us
EllaiSys was a web engineering and technology consulting company specializing in Cloud Computing (AWS and Azure), DevOps, Identity and Access Management (IAM), and Product Engineering. Although we concluded our professional services business in October 2021, we remain committed to maintaining and improving our open-source projects for the benefit of the community.
If this project has been helpful to you or your organization, we'd love your support. There are several ways you can contribute:
- Give some love by starring the repository on GitHub, sharing it with your network, or recommending it to others.
- Spread the word by writing blog posts, creating tutorials, or giving talks about the project.
- Contribute code by fixing bugs, implementing new features, or improving performance.
- Report issues and help us identify bugs or edge cases.
- Improve the documentation by correcting errors, adding examples, or enhancing clarity.
- Share ideas by suggesting new features or improvements.
- Help others by answering questions and participating in community discussions.
- Spread the word by starring the repository, sharing it with your network, or recommending it to others.
Sponsor the Project
Maintaining a high-quality open-source project requires a significant investment of time and effort. If you'd like to support its continued development financially, your sponsorship is greatly appreciated. Every contribution—regardless of size—helps us dedicate more time to maintaining the project, fixing issues, implementing new features, and improving the documentation.
Whether you contribute your time, expertise, or financial support, thank you for helping us build better software for the community.
License
This package is open-source software released under the MIT License.
The source code is available on GitHub and may be used, copied, modified, merged, published, distributed, sublicensed, and/or sold in accordance with the terms of the MIT License.
A copy of the license is included with this package in the License file. Please review the license before using, modifying, or redistributing this software.
Disclaimer
This package is actively maintained and continuously improved.
We welcome bug reports, feature requests, and other feedback from the community. While we will make every reasonable effort to review and address reported issues, support is provided on a voluntary, best-effort basis. As this is an open-source project offered free of charge, we are unable to guarantee response times, issue resolution, or support service level agreements (SLAs).

