This example is part of a guide demonstrating how to integrate Authsignal with AWS Cognito when using React Native.
It's part of a series of guides showing different options for integrating Authsignal with AWS Cognito.
You should follow the prerequisite steps described here to setup your Relying Party and your apple-app-site-association
and assetlinks.json
files.
yarn install
npx pod-install ios
Update this file with the config values for your Authsignal tenant and region-specific URL, along with the values for your AWS Cognito user pool.
You can find the full lambda code for this example here.
You can find the full lambda code for this example here.
You can find a full example of the sign up implementation here.
Pass the email as the username.
await signUp({
username: email,
password: Math.random().toString(36).slice(-16) + 'X', // Dummy value - never used
options: {
userAttributes: {
email,
},
},
});
This step invokes the Create Auth Challenge lambda.
const {nextStep} = await signIn({
username: email,
options: {
authFlowType: 'CUSTOM_WITHOUT_SRP',
},
});
Pass the url returned by the Create Auth Challenge lambda.
const url = nextStep.additionalInfo.url;
const token = await launch(url);
This step invokes the Verify Auth Challenge Response lambda.
const {isSignedIn} = await confirmSignIn({
challengeResponse: token,
});
You can find a full example of the sign in implementation here.
const {data} = await authsignal.passkey.signIn({
action: 'cognitoAuth',
});
Pass the username and token returned by the Authsignal SDK.
await signIn({
username: data.username,
options: {
authFlowType: 'CUSTOM_WITHOUT_SRP',
},
});
const {isSignedIn} = await confirmSignIn({
challengeResponse: data.token,
});