Aws-sdk-ios: AWSMobileClient failed in signIn method

Created on 7 Feb 2019  路  2Comments  路  Source: aws-amplify/aws-sdk-ios

Describe the bug
When I try to log in using the SignIn method with user and password, this method has an error: _Thread 1: Fatal error: Unexpectedly found nil while unwrapping an Optional value._, in structure: SessionToken and line: 429.

To Reproduce
Steps to reproduce the behavior:

  1. call signIn method
  2. See error

Which AWS service(s) are affected?
AWSMobileClient

Expected behavior
That the authentication process is done

Snippet
AWSMobileClient.sharedInstance().signIn(username: "someuser", password: "somepassword") { (signInResult, error) in

Environment(please complete the following information):

  • SDK Version: 2.8.4
  • Dependency Manager: Cocoapods
  • Swift Version: 4.2

Device Information (please complete the following information):

  • Device: Simulator
  • iOS Version: 12.1
  • Specific to simulators: iPhone 8 Plus
mobile client question

All 2 comments

Hello @erickfox

Sorry that you are having issues using the SDK. To help me debug this, could you provide some additional info?

  • Do you have a standard UserPools setup in the backend?
  • If not, can you please provide details of a custom setup?
  • Could you please show how do the contents of your awsconfiguration.json look like? I want to ensure you have the correct constants in it. It should look something like this:
{
    "UserAgent": "aws-amplify/cli",
    "Version": "0.1.0",
    "IdentityManager": {
        "Default": {}
    },
    "CredentialsProvider": {
        "CognitoIdentity": {
            "Default": {
                "PoolId": "us-west-2:xxxxxxxxxxx-7c8b-425f-91c9-xxxxxxxxxxx",
                "Region": "us-west-2"
            }
        }
    },
    "CognitoUserPool": {
        "Default": {
            "PoolId": "us-west-2_XXXX",
            "AppClientId": "xxxxxxxxxxx",
            "AppClientSecret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
            "Region": "us-west-2"
        }
    },
    "PinpointAnalytics": {
        "Default": {
            "AppId": "YOUR_PINPOINT_APP_ID",
            "Region": "us-east-1"
        }
    },
    "PinpointTargeting": {
        "Default": {
            "Region": "us-east-1"
        }
    }
}

Thanks,
Rohan

Hello @rohandubal, I checked my settings, I configured again and now everything works well, I think it could be bad settings in my project. Thanks a lot

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aTylerRice picture aTylerRice  路  3Comments

mohab2014 picture mohab2014  路  4Comments

pawlowskialex picture pawlowskialex  路  4Comments

minhthuc251 picture minhthuc251  路  4Comments

thomers picture thomers  路  3Comments