PHPackages                             yasuaki640/cognito-srp-php - 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. yasuaki640/cognito-srp-php

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

yasuaki640/cognito-srp-php
==========================

Helper written by PHP to get through SRP authentication for Amazon Cognito.

1.1.3(1y ago)212.8k↓46.4%1MITPHPPHP ^8.3

Since Oct 6Pushed 1y ago1 watchersCompare

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

READMEChangelog (5)Dependencies (6)Versions (10)Used By (0)

cognito-srp-php
===============

[](#cognito-srp-php)

Helper written by PHP to get through SRP authentication for Amazon Cognito.

This was written in reference to the [jenky/AwsCognitoIdentitySRP.php](https://gist.github.com/jenky/a4465f73adf90206b3e98c3d36a3be4f).

Install
-------

[](#install)

```
composer require yasuaki640/cognito-srp-php
```

Usage
-----

[](#usage)

```
    // instantiate aws client
    $client = new CognitoIdentityProviderClient([
        ...
    ]);

    // instantiate helper
    $srpHelper = new CognitoSrp(
        'your client id',
        'your pool id',
        'your client secret (required)',
    );

    $result = $client->adminInitiateAuth([
        'AuthFlow' => 'USER_SRP_AUTH',
        'ClientId' => 'your client id',
        'UserPoolId' => 'your pool id',
        'AuthParameters' => [
            'USERNAME' => $username,
             // calculate A
            'SRP_A' => $srpHelper->SRP_A(),
             // calculate secret Hash
            'SECRET_HASH' => $srpHelper->SECRET_HASH($username),
        ],
    ]);

    $authRes = $client->adminRespondToAuthChallenge([
        'ChallengeName' => 'PASSWORD_VERIFIER',
        'UserPoolId' => 'your pool id',
        'ClientId' => 'your client id',
        // generate authentication challenge response params
        'ChallengeResponses' => $srpHelper->ChallengeResponses($result, $password),
    ]);
```

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 95% 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 ~5 days

Total

9

Last Release

549d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/de98cc606d0572063addadf5c85082237dcdb9cf4c1f19e2a37f679cfe348f51?d=identicon)[yasuaki640](/maintainers/yasuaki640)

---

Top Contributors

[![yasuaki640](https://avatars.githubusercontent.com/u/42242014?v=4)](https://github.com/yasuaki640 "yasuaki640 (19 commits)")[![marcispauls](https://avatars.githubusercontent.com/u/1035938?v=4)](https://github.com/marcispauls "marcispauls (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/yasuaki640-cognito-srp-php/health.svg)

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

###  Alternatives

[tymon/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

11.5k49.1M350](/packages/tymon-jwt-auth)[corbosman/laravel-passport-claims

Add claims to Laravel Passport JWT Tokens

88655.9k](/packages/corbosman-laravel-passport-claims)[ellaisys/aws-cognito

AWS Cognito package that allows Auth and other related features using the AWS SDK for PHP

120220.7k1](/packages/ellaisys-aws-cognito)[tg/tgwebvalid

An easy way to validate Telegram Login Widget and Telegram Mini App users on your website using PHP

6821.7k1](/packages/tg-tgwebvalid)[clerkinc/backend-php

2755.0k](/packages/clerkinc-backend-php)[jakub-onderka/openid-connect-php

Bare-bones OpenID Connect client

1151.4k](/packages/jakub-onderka-openid-connect-php)

PHPackages © 2026

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