amazon-archives / amazon-cognito-identity-js

Amazon Cognito Identity SDK for JavaScript
Other
985 stars 454 forks source link

Suppress second factor during MFA is not working while sign In when MFA setting is required or Opt In #634

Closed venkat-nuka closed 6 years ago

venkat-nuka commented 6 years ago

Getting error ‘Missing required key 'DeviceKey' in params’ while invoking method “setDeviceStatusRemembered”. We don’t find method ‘getCachedDeviceKeyAndPassword()’ in javascript SDK as suggested in https://github.com/aws/amazon-cognito-identity-js/issues/519

Steps done: Enabled MFA for user MFA Setting : Optional Remember Device: User OptIn Use a remembered device to suppress the second factor during MFA: Yes

Please suggest as i am new to AWS cognito.

venkat-nuka commented 6 years ago

Also, When below settings are there, app is always showing MFA to enter code during and it is not getting suppressed. Please suggest how to implement this from client side using Javascript SDK Do you want to remember your user's devices? Always Do you want to use a remembered device to suppress the second factor during multi-factor authentication (MFA)? Always

itrestian commented 6 years ago

What's the environment you are using? That particular method might be missing from the typescript definitions you are using. Also are you confirming the device in your code?

itrestian commented 6 years ago

You can have a look at AWS Amplify which exposes a higher order auth component for this SDK. Maybe that can suit your use case. Also note that we will continue developing this library in the AWS Amplify repo. I believe the typescript definitions have been updated as well.

https://github.com/aws/aws-amplify