-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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() Documention #13598
Comments
Hey, @vincedbowen 👋. Sorry to hear you're running into this, and we appreciate you creating this issue in the event we have a gap in our documentation. Just to be clear, was the user in this scenario made within the Cognito console manually? And is the request here to provide better documentation on how to handle this scenario when you need to call To be clear, |
@vincedbowen, just to follow up on this... you'll still need to have Either way, I agree that the docs could use the example linked above for better clarity on this flow. |
Hi @cwomack! Thanks so much for the quick reply 😊. Yes, the user was made in the Console manually, to simulate users being imported from another database (app migration in an organization). For your second question, yes my request is the documentation have a clearer example of calling Finally, no verification code should be sent out because their email is verified when manually entered in the Cognito pool, in which they are sent an invite with there username and temporary password (which does occur as expected). |
Yes, I am calling
I hope this clarifies the flow, but if not, please let me know! The only way I have found to be able to pass in these arguments to
When I inspect the network logs for this call to Cognito, I see something like this:
However, even when passing in userAttributes in a manner similar to the provided example, they never end up in the request to Cognito, and expectedly, I get a |
@vincedbowen on this last bit,
are you asking how to pass in userAttributes during |
Yes, I am. I think the documentation is a bit unclear here. |
@vincedbowen Did you ever figure this out? I have reached the same place in my authentication flow and I don't quite understand what parameters we need to pass here. Do we just pass in the temporary password as the challenge response and then call the resetPassword function? If not, where do we pass the new password into the confirmSignIn function? Any updates on this @ashika112 @cwomack. |
No, I ended up creating a new Cognito pool with the attributes I wanted as optional (since I was controlling the applications login flow). Then I just only passed in the new password, and once logged in, I just updated the attributes from the form immediately. Not an ideal solution, but it worked for the MVP I was developing, and I was tired of debugging lol 😅. |
I did exactly that, and it worked. The only issue I encountered was that I initially wanted to call the |
Glad you figured it out! So did you end up using |
Hi, I also reached the same place and had an issue handling the new password challenge. The documents, which I thought were exceptionally well done and have come a long way, are a little illusive about using confirmSignIn() to handle a new password-required functionality. I used this: confirmNewPassword(password: string): Observable<ConfirmSignInOutput> {
return new Observable((observer) => {
confirmSignIn({
challengeResponse: password,
})
.then((response) => {
observer.next(response);
observer.complete();
})
.catch((error) => {
observer.error(error);
});
});
} I wasn't able to find how to pass in the required user attributes. Please share if you know. |
@vincedbowen, @iTaylor5, and anyone else following this issue, wanted to circle back and let you all know that we're capturing this need for a docs improvement properly within the Typically, we'll close the |
For anybody seing this issue in the future: Since the docs still have not been updated, I found out the correct API call to make in the mean time: await confirmSignIn({
challengeResponse: newPassword,
options: {userAttributes: attributes},
}) where |
Is this related to a new or existing framework?
React Native
Is this related to a new or existing API?
Authentication
Is this related to another service?
Cognito
Describe the feature you'd like to request
Hi team!
I think a documentation update for the
confirmSignIn()
method of the Amplify SDK would be great for users. Currently when signing in unconfirmed users, the documentation saysconfirmSignIn()
should be called. Per the docs, "CONFIRM_SIGN_IN_WITH_NEW_PASSWORD_REQUIRED - The user was created with a temporary password and must set a new one. Complete the process with confirmSignIn", however, there is no further mention of how to call this function. I know I need to pass in a challengeResponse, but I am not sure of how to go about this.Describe the solution you'd like
I would like updated documentation of how to call
confirmSignIn()
to reset a user's temporary password and set required attributes in the Cognito pool.Describe alternatives you've considered
I have tried to update user attributes and reset the user's password individually, using those methods respectively. However, this doesn't work, as the user is not authenticated.
Additional context
signIn()
method. They are authenticated fine, and I can get the user's tokenconfirmSignIn()
Is this something that you'd be interested in working on?
The text was updated successfully, but these errors were encountered: