-
Notifications
You must be signed in to change notification settings - Fork 548
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
Migrate users with a Lambda Trigger #1136
Comments
Having the same issue, not sure how to set |
@Nikooos @patrickkempff It sounds like you are using AWSMobileClient to manage your app's authentication. If so, AWSMobileClient does not yet support custom migrations using Lambda Triggers. Can you clarify which SDKs you're using? |
@palpatim thank you for your reply. I am indeed using AWSMobileClient, mostly because the docs recommend it. Is there an other way to do it without the need of implementing scenario's like transitioning from offline to online and refreshing credentials at the appropriate time so that errors do not occur when actions are taken and connectivity is not available? |
Will custom migrations using LambdaTriggers be supported soon in AWSModileClient? |
Any updates on this? |
Adding our PM @nikhil-dabhade to add insight here on timeline for this feature request. |
any updates on this? We have the same issue and need this to work. |
Any Updates on this? |
Any updates? 😢 |
Has anyone found a solution to this for Android? MigrationEnabled is working for iOS but that's it. |
For anyone down the road I found the solution for Android. Rather than setting the migrationEnabled field, you need to create AuthenticationDetails and AuthenticationHandler objects, set the detail's authenticationType to "USER_PASSWORD", and then call initiateUserAuthentication on your cognitoUserPool instance. Below is an example: val authenticationHandler: AuthenticationHandler = object : AuthenticationHandler {
} val authDetails = AuthenticationDetails(email, password, null) |
to add to @MichaelHighsmith solution, we ended up doing the same thing and in the onSuccess call we just called login with amplify again and that handled the tokens for us. |
@fernandoaguilar It seems that on a fresh install when I try to call cognitoUserPool?.currentUser, that user has a null userID which is throwing a wrench in the authentication. I think signing in a dummy user and then using that user's ID to do the real login would work, but it's definitely not the right way to go. Do you have any advice on how you got around this issue? |
@MichaelHighsmith create a cognito user with the users email when they login. CognitoUser cognitoUser = cognitoUserPool.getUser(email); |
Wow I guess I'd been staring at this for too long...thanks for the help @fernandoaguilar ! |
@MichaelHighsmith no problem! |
Thanks for posting that solution @MichaelHighsmith and sorry everyone for the extended blackout on this ticket! Came up on my radar here with the large number of recent comments. I'll close the issue for now but if others are having difficulties with this, leave a comment and I can reopen it. |
I'm trying to migrate users from our existing user management system into our user pool without a password reset.
For iOS I found this example which explains that adding a boolean to the awsconfiguration.json with the key MigrationEnabled and value YES should do the magic. This works.
For Android I found an example which totally doesn't match our Kotlin setup. For Android we're also using the awsconfiguration.json, but the MigrationEnabled boolean is not doing any magic in this case. Unfortunately with this documentation I can't figure out how to do this in our Android app.
Can anyone point me in the right direction for this?
Environment:
The text was updated successfully, but these errors were encountered: