Aws-sdk-ios: Custom challenge for authenticate

Created on 18 Dec 2017  路  4Comments  路  Source: aws-amplify/aws-sdk-ios

To help us solve your problem better, please answer the following list of questions.

  • What service are you using?
    AWS CognitoIdentityProvider

  • In what version of SDK are you facing the problem?
    2.6.4

  • Is the issue limited to Simulators / Actual Devices?
    No

  • Can your problem be resolved if you bump to a higher version of SDK?
    Not yet

  • Is this problem related to specific iOS version?
    No

  • How are you consuming the SDK? CocoaPods / Carthage / Prebuilt frameworks?
    Pod install

  • Can you give us steps to reproduce with a minimal, complete, and verifiable example? Please include any specific network conditions that might be required to reproduce the problem.

Using the aws-sdk-ios, we are implementing custom auth flow:
http://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-authentication-flow.html

However in the iOS sdk, with the method getSession, the isInitialCustomChallenge value is set to NO. How can I get session with the callback of custom challenge?

result.user.getSession(uuidString, password: password, validationData: nil).continueWith(block: {(task:AWSTask) -> Any? in
if let error = task.error as NSError? {
print("Error.. (error)")
}
else if let result = task.result {
print("Result.. (result)")
}
return nil
})

I am not able to the custom challenge callback. The same for android sdk exist: http://docs.aws.amazon.com/cognito/latest/developerguide/using-amazon-cognito-user-identity-pools-android-sdk.html

Many thanks

If you need help with understanding how to implement something in particular then we suggest that you first look into our developer guide. You can also simplify your process of creating an application by using Mobile Hub.

closing-soon-if-no-response

All 4 comments

After many trial and error, I have been able to sign in with custom challenge using the sdk. I have documented it here: https://medium.com/@victorleungtw/aws-cognito-user-pools-with-mobile-sdk-for-ios-using-custom-challenge-5d40a06a3b07

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

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

Facing the same issue Android SDK does provide the custom_challenge with getSession API itself but couldn't find the way in iOS. Can you suggest?

Was this page helpful?
0 / 5 - 0 ratings