2

I tried the following code and I am getting an exception when I call "providerClient.SignUpAsync" with a message

Unable to store key CognitoIdentity:IdentityId:us-east-1:d8dce20b-7e3a-454a-afe5-xxxxxxxxxxxx, got error: -34018

I am not able to find a way to specify the "userpool id" in the code and I am not able to understand what am I doing wrong here. I would really appreciate if anyone can help me here to tell me what am I doing wrong here.

CognitoAWSCredentials credentials = new CognitoAWSCredentials(
"us-east-1:d8dce20b-7e3a-454a-afe5-xxxxxxxxxxxx",
RegionEndpoint.USEast1
);
AmazonCognitoIdentityProviderClient providerClient = new AmazonCognitoIdentityProviderClient(credentials,RegionEndpoint.USEast1);

    SignUpRequest sr = new SignUpRequest();

    sr.ClientId = "71tu9de9v6murgolfxxxxxxxxx";  
    sr.Username = email;
    sr.Password = password;
    sr.SecretHash = "1b7i7kdjcdij03309j0354d8tubo62it33gj4ulkxxxxxxxxxxxx";
    sr.UserAttributes = new List<AttributeType> {
        new AttributeType
        {
            Name = "email",
            Value = email,
        },
         new AttributeType
            {
                Name = "phone_number",
                Value = phone,
            }
    };
    try{

        SignUpResponse result = await providerClient.SignUpAsync(sr);
    }
S.L. Barth
  • 7,954
  • 71
  • 47
  • 62
  • Welcome to Stack Overflow! I've edited your question, putting the error message in "quote markdown", and putting the code in `code markdown`. You can put things in code markdown by indenting it by 4 spaces. – S.L. Barth Jun 29 '17 at 11:17

1 Answers1

0

Have you added the keychain sharing entitlement to your app? -34018 is a keychain related error. https://github.com/xamarin/Xamarin.Auth/issues/139

behrooziAWS
  • 1,331
  • 6
  • 4