awsmobile-cli icon indicating copy to clipboard operation
awsmobile-cli copied to clipboard

Enabling user-signin feature without the phoneNumber required

Open vahdet opened this issue 6 years ago • 5 comments

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?

vahdet avatar Apr 24 '18 08:04 vahdet

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

LXensen avatar Apr 24 '18 22:04 LXensen

We have informed our Mobile Hub team about it.

UnleashedMind avatar Apr 24 '18 23:04 UnleashedMind

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

swaminator avatar Apr 26 '18 20:04 swaminator

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

elorzafe avatar Apr 30 '18 21:04 elorzafe

@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.

vahdet avatar May 09 '18 21:05 vahdet