yasuaki640/cognito-srp-php
Composer 安装命令:
composer require yasuaki640/cognito-srp-php
包简介
Helper written by PHP to get through SRP authentication for Amazon Cognito.
README 文档
README
Helper written by PHP to get through SRP authentication for Amazon Cognito.
This was written in reference to the jenky/AwsCognitoIdentitySRP.php.
Install
composer require yasuaki640/cognito-srp-php
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), ]);
统计信息
- 总下载量: 13.98k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-10-06