jonsaw / amazon-cognito-identity-dart

Unofficial Amazon Cognito Identity Provider Dart SDK, to easily add user sign-up and sign-in to your mobile and web apps with AWS.
MIT License
204 stars 93 forks source link

Sample give error "Unknown client error occurred" #32

Closed aqwert closed 5 years ago

aqwert commented 5 years ago

I cloned the repo and built the sample.

It runs fine but entering credentials gives the error:

"Unknown client error occurred"

I set the following...

const _awsUserPoolId = 'us-west-2_J********';
const _awsClientId = '3ugt2ss9vtls0s2p*********';

The UserPoolId I got from General Settings > Pool Id and ClientId from General Settings > AppClients > App client id. Is that right?

I believe Cognito is set up correctly but not 100% sure as I am not that familiar with it.

Any suggestions to what I can do?

I also tried logging a user that does not exist and that error is: Unable to verify secret hash for client 3ugt2ss9vtls0s2p*********

aqwert commented 5 years ago

I maybe getting further I followed: https://stackoverflow.com/questions/37438879/unable-to-verify-secret-hash-for-client-in-amazon-cognito-userpools and created an app client without a client app secret.

Get the error Attributes did not conform to the schema: email: the attribute is required.

Will look at it later

aqwert commented 5 years ago

I got it to work. Cognito was setup to record the email address. I just had to add it to the sample.

    final userAttributes = [
      new AttributeArg(name: 'name', value: name),
      new AttributeArg(name: 'email', value: email),
    ];