aws-cognito-srp-client
v1.0.0
Published
SRP Client for AWS Cognito UserPools SRP Auth Flow
Downloads
5,381
Maintainers
Readme
aws-cognito-srp-client
SRP Client for AWS Cognito UserPools SRP Auth Flow
This file can be bundled to work in browser, also works in nodejs.
Usage
Use this library in conjunction with InitiateAuth Api of Cognito
Step 1
Generate SRP_Aimport Srp from "aws-cognito-srp-client"; const srp = new Srp(userPoolId); const srpA = srp.getA();
Step 2 Invoke initiateAuth Api with
USER_SRP_AUTH
AuthFlow
Use SPP_A generated from step 1 to pass input toinitialteAuth
APIStep 3 Calculate
signature
andtimestamp
import Srp from "aws-cognito-srp-client"; const { signature, timestamp } = srp.getSignature( userId, srpB, salt, secret, password );
userId, srpB, salt, and secret are available in the response of
initialteAuth
APIStep 4 Invoke respondToAuthChallenge Api with
PASSWORD_VERIFIER
ChallengeName Usesignature
andtimestamp
from step 3 to passinput torespondToAuthChallenge
API.
Support
This project is a part of Open Source Intitiative from Sodaru Technologies
Write an email to [email protected] for queries on this project