furaiev / amazon-cognito-identity-dart-2

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
187 stars 114 forks source link

Unable to verify secret hash #161

Closed tejas2306 closed 3 years ago

tejas2306 commented 3 years ago

/// Login user

_cognitoUser = CognitoUser(email, _userPool, storage: _userPool.storage, clientSecret: clientSecret);

final authDetails = AuthenticationDetails(
  username: email,
  password: password,
);

bool isConfirmed;
try {
  _session = await _cognitoUser.authenticateUser(authDetails);
  isConfirmed = true;
} on CognitoClientException catch (e) {
  if (e.code == 'UserNotConfirmedException') {
    isConfirmed = false;
  } else {
    rethrow;
  }
}

when i tried to login i am getting this exception

CognitoClientException{statusCode: 400, code: NotAuthorizedException, name: NotAuthorizedException, message: Unable to verify secret hash for client 2qb0o3ni38ge670t48dkkluk5r}

furaiev commented 3 years ago

please go through this topic https://github.com/furaiev/amazon-cognito-identity-dart-2/issues/32 it seems like the same issue