amazon-archives / awsmobile-cli

CLI experience for Frontend developers in the JavaScript ecosystem.
Apache License 2.0
142 stars 35 forks source link

Enabling user-signin feature without the phoneNumber required #112

Open vahdet opened 6 years ago

vahdet commented 6 years ago

I want to use user-signin feature of awsmobile cli for a web application. Running this two lines of command I end up with MobileHub application created:

awsmobile init
awsmobile user-signin enable

However, the AWS Cognito User Pool backing the MobileHub app is created with phoneNumber obligatory. And once the user pool is created with an attribute, there is no way to omit it afterwards.

All in all, is there a way to create user-signin feature so that it does not require phoneNumber, but only username and email address?

LXensen commented 6 years ago

I had the same problem, except MFA is required. You can get around it by pushing the project to Mobile Hub first, after init.

awsmobile init
awsmobile push

Then go to the project in Mobile Hub and enable the User Signin. All the Cognito options are available to enable-disable. Then issue a pull request.

awsmobile pull

Hacky, but it works

UnleashedMind commented 6 years ago

We have informed our Mobile Hub team about it.

swaminator commented 6 years ago

Another workaround is to import a Cognito UserPool into your Hub project: https://docs.aws.amazon.com/aws-mobile/latest/developerguide/add-aws-mobile-user-sign-in.html#auth-setup

elorzafe commented 6 years ago

Hi,

You can try this.

$ awsmobile user-signin enable -p

? Sign-in is currently disabled, what do you want to do next Go to advance setti
ngs
? Which sign-in method you want to configure Cognito UserPools (currently disabl
ed)
? How are users going to login Email, Username
? Password minimum length (number of characters) 8
? Password character requirements uppercase, lowercase, numbers

The user pool doesn't have phone number or MFA

vahdet commented 6 years ago

@elorzafe I've got rid of the phone number by adding user sign-in via the console and relating it to a new user pool consecutively; but your way makes better sense -even if I have not given a try.