amazon-archives / aws-sdk-xamarin

AWS Mobile SDK for Xamarin (Beta)
Apache License 2.0
45 stars 18 forks source link

Cognito AmazonCognitoIdentityProviderClient Signup throwing exception in Xamarin #43

Closed tabenny closed 6 years ago

tabenny commented 7 years ago

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);
    }
tawalke commented 7 years ago

Are you using the latest release of the .NET/Xamarin SDK which is found and was migrated from this version:

GitHub: https://github.com/aws/aws-sdk-net Installation: https://docs.aws.amazon.com/sdk-for-net/v3/developer-guide/net-dg-install-assemblies.html Official Forums: http://forums.aws.amazon.com/forum.jspa?forumID=61 Documentation: https://docs.aws.amazon.com/sdk-for-net/v3/developer-guide/

Thanks, TEW

Sent from Windows Mail

From: tabennymailto:notifications@github.com Sent: ‎Thursday‎, ‎June‎ ‎29‎, ‎2017 ‎1‎:‎32‎ ‎AM To: awslabs/aws-sdk-xamarinmailto:aws-sdk-xamarin@noreply.github.com Cc: Subscribedmailto:subscribed@noreply.github.com

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);
}

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/awslabs/aws-sdk-xamarin/issues/43, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ACMW1sTa7OqavvctlDowRoIaRkE9vB0nks5sIzb6gaJpZM4OI14_.

tabenny commented 7 years ago

Thanks for the response. I updated the SDK through NuGet in Visual Studio just now and ran the code and getting the same error.

I am not sure whether any other way I can call Signup.

tawalke commented 7 years ago

Post on the Forum link I provided, the SDK team should be able to help you quickly as they own the source and they can verify Cognito Sign-up is availability in .NET.

Official Forums: http://forums.aws.amazon.com/forum.jspa?forumID=61

Thanks, TEW

Sent from Windows Mail

From: tabennymailto:notifications@github.com Sent: ‎Thursday‎, ‎June‎ ‎29‎, ‎2017 ‎1‎:‎49‎ ‎AM To: awslabs/aws-sdk-xamarinmailto:aws-sdk-xamarin@noreply.github.com Cc: Tara Walkermailto:taraew@live.com, Commentmailto:comment@noreply.github.com

Thanks for the response. I updated the SDK through NuGet in Visual Studio just now and ran the code and getting the same error.

I am not sure whether any other way I can call Signup.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/awslabs/aws-sdk-xamarin/issues/43#issuecomment-311868866, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ACMW1kgc0cIZXEMDOPKhac1agVgssaOPks5sIzrsgaJpZM4OI14_.

tabenny commented 7 years ago

Thank you very much.

I tried to post there and I got an error, I guess it is because I just signed up. I got the following error "Your account is not ready for posting messages yet. See the following article for details: https://aws.amazon.com/premiumsupport/knowledge-center/error-forum-post/ "

I will try again after few hours

Thank you, Benny

tawalke commented 7 years ago

Okay keep me posted please.

Sent from Windows Mail

From: tabennymailto:notifications@github.com Sent: ‎Thursday‎, ‎June‎ ‎29‎, ‎2017 ‎2‎:‎12‎ ‎AM To: awslabs/aws-sdk-xamarinmailto:aws-sdk-xamarin@noreply.github.com Cc: Tara Walkermailto:taraew@live.com, Commentmailto:comment@noreply.github.com

Thank you very much.

I tried to post there and I got an error, I guess it is because I just signed up. I got the following error "Your account is not ready for posting messages yet. See the following article for details: https://aws.amazon.com/premiumsupport/knowledge-center/error-forum-post/ "

I will try again after few hours

Thank you, Benny

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/awslabs/aws-sdk-xamarin/issues/43#issuecomment-311872038, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ACMW1ruwUk5xkf5liMZ5SwVo4wQ-Pav6ks5sI0BigaJpZM4OI14_.

tawalke commented 7 years ago

We also track from StackOverflow & gitter, see readme for SDK: https://github.com/aws/aws-sdk-net/blob/4cb81be25dcc5d933868cd895652edd6d14c923b/README.md

Sent from Windows Mail

From: Tara Walkermailto:taraew@live.com Sent: ‎Thursday‎, ‎June‎ ‎29‎, ‎2017 ‎2‎:‎26‎ ‎AM To: awslabs/aws-sdk-xamarinmailto:aws-sdk-xamarin@noreply.github.com, awslabs/aws-sdk-xamarinmailto:reply@reply.github.com Cc: Commentmailto:comment@noreply.github.com

Okay keep me posted please.

Sent from Windows Mail

From: tabennymailto:notifications@github.com Sent: ‎Thursday‎, ‎June‎ ‎29‎, ‎2017 ‎2‎:‎12‎ ‎AM To: awslabs/aws-sdk-xamarinmailto:aws-sdk-xamarin@noreply.github.com Cc: Tara Walkermailto:taraew@live.com, Commentmailto:comment@noreply.github.com

Thank you very much.

I tried to post there and I got an error, I guess it is because I just signed up. I got the following error "Your account is not ready for posting messages yet. See the following article for details: https://aws.amazon.com/premiumsupport/knowledge-center/error-forum-post/ "

I will try again after few hours

Thank you, Benny

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/awslabs/aws-sdk-xamarin/issues/43#issuecomment-311872038, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ACMW1ruwUk5xkf5liMZ5SwVo4wQ-Pav6ks5sI0BigaJpZM4OI14_.

tabenny commented 7 years ago

I found a link in another site, with same kind of error message as this "Unable to store key CognitoIdentity:IdentityId:us-east-1:d8dce20b-7e3a-454a-afe5-xxxxxxxxxxxx, got error: -34018"

The error code was -34018.

The solution given was to add Entitlements.plist in Code Signing option, then specified the provisioning profile.

Now the error is different, its giving error as "System.IO.InvalidDataException: Cannot determine protocol at Amazon.Runtime.Internal.Signer.SignRequest".

Another person suggested to use Anonymous credentials to get the above error fixed, when I did then error was related with Secret hash code which is about unable to verify the Secret Hash.

tawalke commented 7 years ago

Did you get it resolved?

dipgada commented 6 years ago

was anyone able to resolve the issue? I get the same error "Cannot determine protocol" once the application is hosted on the EC2 instance but it works from my local machine. Also this error only happens when signing up user. Authenticating existing users works both locally as well as on the EC2 instance

frankmuellr commented 6 years ago

Hello @tabenny, @tawalke, and @dipgada,

Sorry for the delay. Do you still require help with this issue?

tabenny commented 6 years ago

Thank you for checking about the issue.It got resolved  -------- Original message --------From: Frank Mueller notifications@github.com Date: 10/31/18 3:12 PM (GMT-05:00) To: awslabs/aws-sdk-xamarin aws-sdk-xamarin@noreply.github.com Cc: tabenny tabenny@gmail.com, Mention mention@noreply.github.com Subject: Re: [awslabs/aws-sdk-xamarin] Cognito AmazonCognitoIdentityProviderClient Signup throwing exception in Xamarin (#43) Hello @tabenny, @tawalke, and @dipgada, Sorry for the delay. Do you still require help with this issue?

—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread. {"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/awslabs/aws-sdk-xamarin","title":"awslabs/aws-sdk-xamarin","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/awslabs/aws-sdk-xamarin"}},"updates":{"snippets":[{"icon":"PERSON","message":"@muellerfr in #43: Hello @tabenny, @tawalke, and @dipgada,\r\n\r\nSorry for the delay. Do you still require help with this issue?"}],"action":{"name":"View Issue","url":"https://github.com/awslabs/aws-sdk-xamarin/issues/43#issuecomment-434806752"}}} [ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/awslabs/aws-sdk-xamarin/issues/43#issuecomment-434806752", "url": "https://github.com/awslabs/aws-sdk-xamarin/issues/43#issuecomment-434806752", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } }, { "@type": "MessageCard", "@context": "http://schema.org/extensions", "hideOriginalBody": "false", "originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB", "title": "Re: [awslabs/aws-sdk-xamarin] Cognito AmazonCognitoIdentityProviderClient Signup throwing exception in Xamarin (#43)", "sections": [ { "text": "", "activityTitle": "Frank Mueller", "activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png", "activitySubtitle": "@muellerfr", "facts": [

] } ], "potentialAction": [ { "name": "Add a comment", "@type": "ActionCard", "inputs": [ { "isMultiLine": true, "@type": "TextInput", "id": "IssueComment", "isRequired": false } ], "actions": [ { "name": "Comment", "@type": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"IssueComment\",\n\"repositoryFullName\": \"awslabs/aws-sdk-xamarin\",\n\"issueId\": 43,\n\"IssueComment\": \"{{IssueComment.value}}\"\n}" } ] }, { "name": "Close issue", "@type": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"IssueClose\",\n\"repositoryFullName\": \"awslabs/aws-sdk-xamarin\",\n\"issueId\": 43\n}" }, { "targets": [ { "os": "default", "uri": "https://github.com/awslabs/aws-sdk-xamarin/issues/43#issuecomment-434806752" } ], "@type": "OpenUri", "name": "View on GitHub" }, { "name": "Unsubscribe", "@type": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 237198911\n}" } ], "themeColor": "26292E" } ]