Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConfirmSignIn to set a new password with user attribute doesn't work during first access #2622

Closed
1 task done
gianluigi-bresaola opened this issue Nov 4, 2023 · 9 comments
Labels
auth Related to the Auth category/plugins bug Something isn't working

Comments

@gianluigi-bresaola
Copy link

Before opening, please confirm:

Language and Async Model

Kotlin

Amplify Categories

Authentication

Gradle script dependencies

// Put output below this line
implementation 'com.amplifyframework:core:2.14.2' 
implementation 'com.amplifyframework:aws-auth-cognito:2.14.2'

Environment information

# Put output below this line
------------------------------------------------------------
Gradle 7.4                                                  
------------------------------------------------------------

Build time:   2022-02-08 09:58:38 UTC
Revision:     f0d9291c04b90b59445041eaa75b2ee744162586

Kotlin:       1.5.31
Groovy:       3.0.9
Ant:          Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM:          17.0.6 (JetBrains s.r.o. 17.0.6+0-b2043.56-10027231)
OS:           Windows 10 10.0 amd64

Please include any relevant guides or documentation you're referencing

No response

Describe the bug

After first sign in with a temporary password I receive CONFIRM_SIGN_IN_WITH_NEW_PASSWORD step, then I confirm with a new password and phone number but I get the follow error:
InvalidParameterException{message=One or more parameters are incorrect., cause=InvalidParameterException(message=Invalid attributes given, phone_number is missing), recoverySuggestion=Enter correct parameters.}
Phone number is in format "+ country code number" like as amplify documentation descibes and is provided as attribute to confirmSignIn function.

Reproduction steps (if applicable)

No response

Code Snippet

// Put your code below this line.
val options = AWSCognitoAuthConfirmSignInOptions.builder()
            .userAttributes(
                listOf(
                    AuthUserAttribute(
                        AuthUserAttributeKey.phoneNumber(),
                        "+XXYYYYYYY"
                    )
                )
            )
            .build()

        Amplify.Auth.confirmSignIn(
            newPassword,
            options,
            { 
                onSuccess()
            },
            {
                onError()
               
            }
        )

Log output

// Put your logs below this line
InvalidParameterException{message=One or more parameters are incorrect., cause=InvalidParameterException(message=Invalid attributes given, phone_number is missing), recoverySuggestion=Enter correct parameters.}

amplifyconfiguration.json

{
"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": "poolid",
"AppClientId": "clientid",
"Region": "eu-west-1"
}
},
"Auth": {
"Default": {
"authenticationFlowType": "USER_SRP_AUTH",
"socialProviders": [],
"usernameAttributes": [],
"signupAttributes": [
"EMAIL"
],
"passwordProtectionSettings": {
"passwordPolicyMinLength": 8,
"passwordPolicyCharacters": []
},
"mfaConfiguration": "ON",
"mfaTypes": [
"SMS"
],
"verificationMechanisms": [
"EMAIL"
]
}
}
}
}
}
}

GraphQL Schema

// Put your schema below this line

Additional information and screenshots

No response

@ankpshah
Copy link
Contributor

ankpshah commented Nov 5, 2023

Hello,
The placeholder "+XXYYYYYYY" does not seem to follow the E.164 format.

@ankpshah ankpshah added the pending-community-response Issue is pending response from the issue requestor label Nov 5, 2023
@gianluigi-bresaola
Copy link
Author

Hello,
thank you for the reply.
That's a fake placeholder to hide my personal number.
The number I send with attributes is "+39349411XXXX" , I tried with another number but I get the same error.
I tried with same code but Ios amplify version and I can reach the end of first access flow with same account.

@gpanshu gpanshu added pending-triage Issue is pending triage and removed pending-community-response Issue is pending response from the issue requestor labels Nov 6, 2023
@gianluigi-bresaola
Copy link
Author

Hello,
inside the library source code, I found that property "userAttributes" of the class AWSCognitoAuthConfirmSignInOptions is not used inside function "_confirmSignIn" in the class RealAWSCognitoAutjPlugin, so the phone number attribute never reach the backend.

@tylerjroach tylerjroach added the bug Something isn't working label Nov 16, 2023
@tylerjroach
Copy link
Member

Thank you for digging into this. Will take a further look.

@tylerjroach
Copy link
Member

@gianluigi-bresaola Just wanted to provide an update that I've worked on a fix and we will work on getting this into a release. #2640

@tjleing tjleing added auth Related to the Auth category/plugins and removed pending-triage Issue is pending triage labels Nov 20, 2023
@marcozabo
Copy link

Same problem here, @tylerjroach do you know when the fix will be released?

@tylerjroach
Copy link
Member

@marcozabo I can't provide a definitive release date, but since it has been merged, it will be a part of our next release.

@tylerjroach
Copy link
Member

@gianluigi-bresaola @marcozabo The fix has been released in v2.14.6. Please let us know if you are still having issues signing in.

@gpanshu gpanshu closed this as completed Dec 15, 2023
Copy link
Contributor

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auth Related to the Auth category/plugins bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants