Amplify-cli: Authentication using phone number only

Created on 25 Jun 2019  Â·  6Comments  Â·  Source: aws-amplify/amplify-cli

Is your feature request related to a problem? Please describe.
Yes - when I tried using Amplify for authenticating users using a phone number and TOTP, I ran into some issues.

Describe the solution you'd like
I'd like there to be another "alternative sign in" option, where you can sign up/sign in using your phone number only (and TOTP for verification on both registration and login).

Describe alternatives you've considered
You could use the hash of the phone number as the username, the phone number as the password, and enable MFA. However, that would be extremely hack-y, and so I'd prefer not to use it.

Additional context
aws-amplify/aws-sdk-android#1012 (and more specifically https://github.com/aws-amplify/aws-sdk-android/issues/1012#issuecomment-505580288).

// cc @undefobj

auth feature-request

Most helpful comment

@attilah any updates?

All 6 comments

@itaisteinherz thanks for the feature request I take this to the team and get back to you with the result of our discussion.

@attilah any updates?

@attilah any update on this issue. I am facing the same problem.

---------> Phone Signup Error ---->
{code: “InvalidParameterException”, name: “InvalidParameterException”, message: “Attributes did not conform to the schema: email: The attribute is required↵“}
code: “InvalidParameterException”
message: “Attributes did not conform to the schema: email: The attribute is required↵”
name: “InvalidParameterException”

@attilah any update ?

I am facing the same issue

```// snippet
const signUpObj = {
“ClientId”: “myClientId”,
“Username”: “+12027953213”,
“Password”: “1595375749602”,
“UserAttributes”: [],
“ValidationData”: null
};

try {
const result: SignUpResult = await Auth.signUp(signUpObj);
resolve(result);
} catch(error) {
console.log(error)
}
// end of snippet

// result:
/*
{
“__type”: “InvalidParameterException”,
“message”: “Attributes did not conform to the schema: email: The attribute is required\n”
}*/

I have temporary solution for this issue so that I can just move on, but we need to have phone only signup feature for this, thank you.

```const username = this.phone_number.value;
const email = 'any.[email protected]';

  const signUpObj = {
    username,
    password: Date.now().toString(),
    attributes: {
      email,
    }
  };

  const signUp = this._auth.signUp(signUpObj);

// work on results below

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MageMasher picture MageMasher  Â·  3Comments

gabriel-wilkes picture gabriel-wilkes  Â·  3Comments

onlybakam picture onlybakam  Â·  3Comments

rehos picture rehos  Â·  3Comments

ReidWeb picture ReidWeb  Â·  3Comments