Open irisk29 opened 2 years ago
@irisk29 This is not currently supported, due to a Cognito limitation that device tracking functionality can only be used in tandem with the USER_SRP_AUTH flow.
@haverchuck in amplifyconfiguration under Auth I have this set: "authenticationFlowType": "USER_SRP_AUTH"
Is this not enough?
If not, are you aware of any other solution that I can use?
@irisk29 If you want to do device tracking, I believe you would have to use the signIn APIs to login directly to Cognito User Pools instead of using the Hosted UI OAuth flow. We have a prebuilt UI component for these called the Authenticator. However, in either case you would not be able to use device tracking with social provider logins.
Please note the Authenticator also can hook in to hosted UI for social provider logins if these are part of your config, but to use device tracking you will need to login directly with Cognito User Pools
If I understand it correctly, the rememberDevice will only work if the users sign in using username and password? How would you in that case refresh the idToken and let Amplify know about the fresh idToken? Isn't social sign ins a big part of Amplify Auth? Maybe I'm misunderstanding exactly what rememberDevice does!
Description
Hello, I want to allow only one sign in for user in my app, I found here https://github.com/aws-amplify/amplify-flutter/issues/1206 a suggested solution to use the RememberDevice feature.
The user logged in and then I wanted to remember the device but I encountered an error:
flutter: Remember device failed with error: DeviceNotTrackedException(message: This device does not have an id, either it was never tracked or previously forgotten., recoverySuggestion: Call remeberDevice to track the device, underlyingException: The operation couldn’t be completed. (AmplifyPlugins.AWSCognitoAuthError error 17.))
I run the amplify auth console and activated the remember device feature in cognito. Is there something that I'm missing?
Categories
Steps to Reproduce
this code produces the error for me:
`await Amplify.Auth.signInWithWebUI(provider: authProvider);
try { await Amplify.Auth.rememberDevice(); var d = await Amplify.Auth.fetchDevices(); for (var dd in d) { print("device name: ${dd.name}"); } print('Remember device succeeded'); } on Exception catch (e) { print('Remember device failed with error: $e'); }`
Screenshots
My cognito:
Platforms
Environment
Dependencies
Device
iPhone 13
OS
iOS 15.2.0
CLI Version
7.6.26
Additional Context
https://github.com/aws-amplify/amplify-js/issues/9318 https://github.com/aws-amplify/amplify-android/issues/2258 https://github.com/aws-amplify/amplify-swift/issues/2708