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

Handle FORCE_CHANGE_PASSWORD without delegate for AWSCognitoIdentityUser #1038

Closed
mrmrdolph opened this issue Sep 12, 2018 · 4 comments
Closed
Assignees
Labels
cognito Issues related to AWS Cognito pending-response Issue is pending response from the issue requestor question General question

Comments

@mrmrdolph
Copy link

Iv'e created a custom AWSIdentityProviderManager to provide login maps from either Google or user pool. Because i need to support login trough both Im not using the AWSCognitoIdentityInteractiveAuthenticationDelegate as its tightly coupled with user pool sign in flow. However i have basically copied the behaviour with a custom generic "sign in controller" that signs in user pool users explicitly through getSession(***, password: **.... But now when i've moved to our live pool users are created in the console with FORCE_CHANGE_PASSWORD and i've encountered a problem.

Expected behaviour on "pool sign in": error message that user. needs to change password. handle navigation and changePassword(" ", proposedPassword: " ") myself explicitly.

What i get on pool sign in: "startNewPasswordRequired not implemented by authentication delegate" on change password: Authentication delegate not set

Do i need to implement the delegate? I don't see how that would work when supporting google in the same login controller that is pushed on the ui, as the completion for that delegate is built around supplying a username and password.

@minbi
Copy link
Contributor

minbi commented Sep 27, 2018

If you are re-implementing the functionality of the SDK, then you will need a handle for startNewPasswordRequired. If Google does not have this functionality, then your implementation need not call the handle when handling a Google sign-in.

@frankmuellr frankmuellr added Auth cognito Issues related to AWS Cognito and removed Auth labels Sep 28, 2018
@mrmrdolph
Copy link
Author

I ended up having to make the signin controller an AWSCognitoIdentityInteractiveAuthenticationDelegate itself (only if user clicks pool signin) to be able to respond to force change password as get session will look for a delegate in its source code on fail, there seems to be no other way.

This works but also introduces some memory leek as the sigin controllen can never be deallocated now because that AWS delegate is not marked as weak and cant be set to nil.

I dont understand why amazon does not support this outside of using their terrible mobile hub signin or a websignin.

@rohandubal
Copy link
Contributor

Hello @mrmrdolph

To simplify this use-case and some other use-cases, we have released an updated version of AWSMobileClient with SDK version 2.7.x+

You can now do that with simple signIn and confirmSignIn APIs without setting any delegates. You can find the documentation here:

https://aws-amplify.github.io/docs/ios/authentication#force-change-password

Please let us know if this resolves your use-case.

Thanks,
Rohan

@rohandubal rohandubal added the pending-response Issue is pending response from the issue requestor label Dec 11, 2018
@stale
Copy link

stale bot commented Dec 26, 2018

This issue has been automatically closed because of inactivity. Please open a new issue if are still encountering problems.

@stale stale bot closed this as completed Dec 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cognito Issues related to AWS Cognito pending-response Issue is pending response from the issue requestor question General question
Projects
None yet
Development

No branches or pull requests

4 participants