Closed caramelfactorydevp closed 1 year ago
Hi @caramelfactorydevp - It looks like you are calling resetPassword
with a phone number, but the config you shared has the usernameAttributes set to email. Have you configured Amplify to use phone number as a username? I also see that you have verificationMechanisms
set to email. Have you configured Amplify to use phone number for verification?
Hi apology, I think I have copied the wrong config into this issue. The config below is what I am currently using.
const amplifyconfig = ''' { "UserAgent": "aws-amplify-cli/2.0", "Version": "1.0", "api": { "plugins": { "awsAPIPlugin": { "appsync-XXX": { "endpointType": "GraphQL", "endpoint": "XXX", "region": "us-east-1", "authorizationType": "AWS_IAM" } } } }, "auth": { "plugins": { "awsCognitoAuthPlugin": { "UserAgent": "aws-amplify-cli/0.1.0", "Version": "0.1.0", "IdentityManager": { "Default": {} }, "AppSync": { "Default": { "ApiUrl": "XXX", "Region": "us-east-1", "AuthMode": "AWS_IAM", "ClientDatabasePrefix": "appsync-XXX_AWS_IAM" } }, "CredentialsProvider": { "CognitoIdentity": { "Default": { "PoolId": "us-east-1:XXX", "Region": "us-east-1" } } }, "CognitoUserPool": { "Default": { "PoolId": "us-east-1_XXX", "AppClientId": "XXX", "Region": "us-east-1" } }, "Auth": { "Default": { "OAuth": { "WebDomain": "XXX", "AppClientId": "XXX", "SignInRedirectURI": "http://localhost:3000/", "SignOutRedirectURI": "http://localhost:3000/signout", "Scopes": [ "email", "openid", "profile" ] }, "authenticationFlowType": "USER_SRP_AUTH", "socialProviders": [], "usernameAttributes": [ "PHONE_NUMBER" ], "signupAttributes": [], "passwordProtectionSettings": { "passwordPolicyMinLength": 8, "passwordPolicyCharacters": [ "REQUIRES_LOWERCASE", "REQUIRES_UPPERCASE" ] }, "mfaConfiguration": "ON", "mfaTypes": [ "SMS", "TOTP" ], "verificationMechanisms": ["PHONE_NUMBER"] } } } } } }''';
Besides, the phone number that I am using has been verified
Okay. I have a few follow up questions:
Amplify.Auth.fetchUserAttributes()
will contain info on which attributes are verified.I saw the banner in my SNS, and I haven't registered the origination number yet. Is this the reason that I can't callreset password
? The image below is the documentation about reset password that I found.
I have a requirement that i have to use aws authentication in my app, now i remember that the backend guy told me to use aws cognito. When i was doing research i came across aws amplify. Now i am confused if i can use aws amplify or not. Please guide me here!
@faisalmushtaq007 - amplify_auth_cognito uses AWS Cognito. You can use the Amplify CLI to create a new Cognito backend, or you can use an existing Cognito backend as described here. If you have any other questions, please open a new issue so that we can keep this issue focused on the reset password flow and SMS use. Thanks.
@caramelfactorydevp - I was able to reproduce this when creating an app with the Amplify CLI and accepting the majority of the default settings. I looked into the failures in AWS SNS (note: to do this you need to enable logging in SNS). I found that the messages were failing with this message: Phone carrier has blocked this message
.
It is possible that your messages are being blocked by the carriers. Have you registered your toll free number?
Note: I was able to get messages to send again simply by updating the message template from the default to something a little more custom to my sample app. That may work, but I would suggest looking at the TFN docs above.
If you have already registered your TFN, can you enable logging in SNS and let me know if there is a failure log?
I am going to close this out since we have not heard back and I think it is likely that your messages were simply being blocked by carriers as spam. If you are still experiencing this issue please enable logging in SNS and share the failure reason.
Description
I am working on a feature "Forgot Password" which allows the user to receive a verification code from the SMS message than reset the password to the new one. However, when I call the function
await Amplify.Auth.resetPassword( username: phoneNum,);
, no messages regarding this are received. When I check the SNS, I haven't reached the limit yet and the signIn and resendSignUpCode are working as well. Besides, I can't find any errors in the SMS delivery logs in the SNS. Can I know what is the issue regarding this?Categories
Steps to Reproduce
No response
Screenshots
No response
Platforms
Android Device/Emulator API Level
No response
Environment
Dependencies
Device
IPhone 14
OS
IOS 14
Deployment Method
Amplify CLI
CLI Version
No response
Additional Context
No response
Amplify Config
const amplifyconfig = ''' { "UserAgent": "aws-amplify-cli/2.0", "Version": "1.0", "auth": { "plugins": { "awsCognitoAuthPlugin": { "UserAgent": "aws-amplify-cli/0.1.0", "Version": "0.1.0", "IdentityManager": { "Default": {} }, "CognitoUserPool": { "Default": { "PoolId": "", "AppClientId": "", "Region": "" } }, "Auth": { "Default": { "OAuth": { "WebDomain": "", "AppClientId": "", "SignInRedirectURI": "http://localhost:3000/", "SignOutRedirectURI": "http://localhost:3000/signout", "Scopes": [ "email", "openid", "profile" ] }, "authenticationFlowType": "USER_SRP_AUTH", "socialProviders": [], "usernameAttributes": [ "EMAIL" ], "signupAttributes": [], "passwordProtectionSettings": { "passwordPolicyMinLength": 8, "passwordPolicyCharacters": [ "REQUIRES_LOWERCASE", "REQUIRES_UPPERCASE" ] }, "mfaConfiguration": "OFF", "mfaTypes": [], "verificationMechanisms": [ "EMAIL" ] } } } } } }''';