Reputation: 5375
I'm trying to follow this guide for creating a new user, changing password, etc... using AWS Cognito and AWS user pools. I can't seem to find the proper Xamarin SDK for Android/iOS. Is there one that exists?
More specifically I'm having issues creating a Cognito User Pool object. In the sample I linked they have this:
CognitoUserPool userPool = new CognitoUserPool(context, userPoolId, clientId, clientSecret);
// user pool can also be created with client app configuration:
CognitoUserPool userPool = new CognitoUserPool(context, userPoolId, clientId, clientSecret, clientConfiguration);
There doesn't seem to be a CognitoUserPool
class. I can't find anything in the AWSSDK.CognitoIdentity
library that is similar or has similar constructors or anything. Am I missing something or is this just not supported yet?
I also can't find anything similar to the SignUpHandler
class from the Register a new user
sample code shown here:
// create a handler for registration
SignUpHandler handler = new SignUpHandler() {
@Override
public void onSuccess(CognitoUser user, boolean signUpConfirmation) {
// The sign up was successful, "user" is a CognitoUser object of the user who was signed up.
// "signUpConfirmation" will indicate if user is already confirmed.
}
@override
public void onFailure(Exception exception) {
// Sign up failed, code check the exception for cause and perform remedial actions.
}
}
Upvotes: 0
Views: 1639
Reputation: 8090
Here is an example of using AWS Cognito with Xamarin Forms:
https://github.com/curtisshipley/CognitoForms
Upvotes: 1
Reputation: 1790
I know this question / answer is old, but my search brought me here and hopefully I can help others.
You can now utilize user pools in the AWS .Net SDK by installing the AWSSDK.Extensions.CognitoAuthentication Nuget package.
Nuget: https://www.nuget.org/packages/AWSSDK.Extensions.CognitoAuthentication
Upvotes: 1
Reputation: 5661
I just answered a similar question in another post.
The short answer, currently, Cognito User Pools client side SDK is not supported for Xamarin/Unity SDKs. The API shapes are avaialable to interact with the service directly but you will not find helper like CognitoUserPool
and CognitoUser
in any other SDK other than Android, iOS and JavaScript.
Upvotes: 3
Reputation: 1201
Amazon provides a C#/.NET SDK via NuGet, which will be the most up-to-date version and should provide the functionality that you require.
You can find this package here: https://www.nuget.org/packages/AWSSDK.CognitoIdentity/
You can also download the NuGet via the NuGet Console:
Install-Package AWSSDK.CognitoIdentity -Version 3.1.1.2
Finally, it can be added via NuGet Packages in Xamarin Studio by searching for:
AWSSDK.CognitoIdentity
Thanks!
Upvotes: 2