in packages/amplify-e2e-core/src/categories/auth.ts [740:898]
export function addAuthUserPoolOnly(cwd: string, settings: any): Promise<void> {
return new Promise((resolve, reject) => {
const {
FACEBOOK_APP_ID,
FACEBOOK_APP_SECRET,
GOOGLE_APP_ID,
GOOGLE_APP_SECRET,
AMAZON_APP_ID,
AMAZON_APP_SECRET,
APPLE_APP_ID,
APPLE_TEAM_ID,
APPLE_KEY_ID,
APPLE_PRIVATE_KEY,
} = getSocialProviders(true);
spawn(getCLIPath(), ['add', 'auth'], { cwd, stripColors: true })
.wait('Do you want to use the default authentication and security configuration?')
.sendKeyDown(2)
.sendCarriageReturn()
.wait('Select the authentication/authorization services that you want to use')
.sendKeyDown()
.sendCarriageReturn()
.wait('Provide a friendly name for your resource that will be used')
.sendCarriageReturn()
.wait('Provide a name for your user pool')
.sendCarriageReturn()
.wait('How do you want users to be able to sign in')
.sendCarriageReturn()
.wait('Do you want to add User Pool Groups?')
.sendCarriageReturn()
.wait('Provide a name for your user pool group')
.sendLine('userPoolGroup1')
.wait('Do you want to add another User Pool Group')
.sendConfirmYes()
.wait('Provide a name for your user pool group')
.sendLine('userPoolGroup2')
.wait('Do you want to add another User Pool Group')
.sendCarriageReturn()
.wait('Sort the user pool groups in order of preference')
.sendCarriageReturn()
.wait('Do you want to add an admin queries API?')
.sendCarriageReturn()
.wait('Do you want to restrict access to the admin queries API')
.sendCarriageReturn()
.wait('Select the group to restrict access with')
.sendCarriageReturn()
.wait('Multifactor authentication (MFA) user login options')
.sendKeyDown()
.sendCarriageReturn()
.wait('For user login, select the MFA types')
.sendLine('a')
.wait('Specify an SMS authentication message')
.sendCarriageReturn()
.wait('Email based user registration/forgot password')
.sendCarriageReturn()
.wait('Specify an email verification subject')
.sendCarriageReturn()
.wait('Specify an email verification message')
.sendCarriageReturn()
.wait('Do you want to override the default password policy')
.sendConfirmYes()
.wait('Enter the minimum password length for this User Pool')
.sendCarriageReturn()
.wait('Select the password character requirements for your userpool')
.sendLine('a')
.wait('What attributes are required for signing up?')
.sendCarriageReturn()
.wait('Specify the app')
.sendCarriageReturn()
.wait('Do you want to specify the user attributes this app')
.sendConfirmYes()
.wait('Specify read attributes')
.sendCarriageReturn()
.wait('Specify write attributes')
.sendCarriageReturn()
.wait('Do you want to enable any of the following capabilities?')
.sendCarriageReturn()
.wait('Do you want to use an OAuth flow')
.sendCarriageReturn()
.wait('What domain name prefix do you want to use?')
.sendCarriageReturn()
.wait('Enter your redirect signin URI')
.sendLine('https://signin1/')
.wait('Do you want to add another redirect signin URI')
.sendConfirmNo()
.wait('Enter your redirect signout URI')
.sendLine('https://signout1/')
.wait('Do you want to add another redirect signout URI')
.sendConfirmNo()
.wait('Select the OAuth flows enabled for this project')
.sendCarriageReturn()
.wait('Select the OAuth scopes enabled for this project')
.sendCarriageReturn()
.wait('Select the social providers you want to configure for your user pool')
.sendLine('a')
.wait('Enter your Facebook App ID for your OAuth flow')
.sendLine(FACEBOOK_APP_ID)
.wait('Enter your Facebook App Secret for your OAuth flow')
.sendLine(FACEBOOK_APP_SECRET)
.wait('Enter your Google Web Client ID for your OAuth flow')
.sendLine(GOOGLE_APP_ID)
.wait('Enter your Google Web Client Secret for your OAuth flow')
.sendLine(GOOGLE_APP_SECRET)
.wait('Enter your Amazon App ID for your OAuth flow')
.sendLine(AMAZON_APP_ID)
.wait('Enter your Amazon App Secret for your OAuth flow')
.sendLine(AMAZON_APP_SECRET)
.wait('Enter your Services ID for your OAuth flow')
.sendLine(APPLE_APP_ID)
.wait('Enter your Team ID for your OAuth flow')
.sendLine(APPLE_TEAM_ID)
.wait('Enter your Key ID for your OAuth flow')
.sendLine(APPLE_KEY_ID)
.wait('Enter your Private Key for your OAuth flow')
.sendLine(APPLE_PRIVATE_KEY)
.wait('Do you want to configure Lambda Triggers for Cognito')
.sendConfirmYes()
.wait('Which triggers do you want to enable for Cognito')
.send('a')
.sendLine(' ')
.wait('What functionality do you want to use for Create Auth Challenge')
.sendKeyDown(3)
.sendLine(' ')
.wait('What functionality do you want to use for Custom Message')
.sendKeyDown(2)
.sendLine(' ')
.wait('What functionality do you want to use for Define Auth Challenge')
.sendKeyDown(3)
.sendLine(' ')
.wait('What functionality do you want to use for Post Authentication')
.sendCarriageReturn()
.wait('What functionality do you want to use for Post Confirmation')
.sendCarriageReturn()
.wait('What functionality do you want to use for Pre Authentication')
.sendCarriageReturn()
.wait('What functionality do you want to use for Pre Sign-up')
.sendCarriageReturn()
.wait('What functionality do you want to use for Verify')
.sendCarriageReturn()
.wait('What functionality do you want to use for Pre Token')
.sendCarriageReturn()
.wait('Do you want to edit your custom function now')
.sendConfirmNo()
.wait('Successfully')
.wait('Do you want to edit your custom function now')
.sendConfirmNo()
.wait('Successfully')
.wait('Do you want to edit your custom function now')
.sendConfirmNo()
.sendEof()
.run((err: Error) => {
if (!err) {
resolve();
} else {
reject(err);
}
});
});
}