Aws-sdk-ios: "authenticationFlowType": "USER_PASSWORD_AUTH" being ignored

Created on 31 Mar 2020  Â·  6Comments  Â·  Source: aws-amplify/aws-sdk-ios

Hey Guys,

I am trying to use USER_PASSWORD_AUTH, but doing it through aswconfiguration.json or on memory does not work. It keeps using USER_SRP_AUTH.

{
"CognitoUserPool": {
"Default": {
"PoolId": "us-west-2_xxxx",
"AppClientId": "xxxx",
"AppClientSecret": "xxxxx",
"Region": "us-west-2"
}
},
"Auth": {
"Default": {
"authenticationFlowType": "USER_PASSWORD_AUTH"
}
}
}

Uploading Screen Shot 2020-03-31 at 2.14.40 PM.png…

Environment(please complete the following information):

  • "aws-amplify/aws-sdk-ios" "2.13.0" - Carthage
  • Dependency Manager: [e.g. Cocoapods, Carthage]
  • iOS 10.0 or Higher
mobile client question requesting info

Most helpful comment

hey looks like you can force USER_PASSWORD_AUTH with this setting in your awsconfiguration.json MigrationEnabled: True, took me a while to find this in the code, couldnt find this documented anywhere, pretty frustrating these past hours have been. Hope this helps.

All 6 comments

hey looks like you can force USER_PASSWORD_AUTH with this setting in your awsconfiguration.json MigrationEnabled: True, took me a while to find this in the code, couldnt find this documented anywhere, pretty frustrating these past hours have been. Hope this helps.

Hey @fernandoaguilar , thanks for that. I have found this as well, but not sure how to make it work since I have to do a CUSTOM_AUTH and if the user is not found I do the migration.. Can you share your awsconfiguration.json if that is ok? Thanks a lot for your help

Hi @VinnyScorsatto

Can you please give an idea of your auth flow? We would like to understand your use case and try to reproduce the scenario. Looks like you are using different type of auth mechanism in a single app and it is not something that AWSMobileClient currently support.
Also, what all lambda triggers are you planning to use?

Hey @royjit , thanks for that,

Sure.. So basically I am following our web flow.

I first do CUSTOM_AUTH, but if the user is not found, I do USER_PASSWORD_AUTH that triggers a user migration to from our db to cognito.

Since there is no way to use two auth flows, I will probably need to handle the migration out of the AWSMobileClient.

Discussing with my team, we believe that I can try to use only USER_PASSWORD_AUTH with this setting in MigrationEnabled: True. I will give it a try and let you know... thanks

Hey @royjit , I managed to make it worked using USER_PASSWORD_AUTH and setting MigrationEnabled: True. So I will close it for now. Thanks @fernandoaguilar for the tip!

@Vinnyscorsatto no problem. Glad I could help!

Was this page helpful?
0 / 5 - 0 ratings