Sign In with Device
Our Flutter SDK offers the easiest way to integrate Cotter's Sign In with Device. You can simply call a function and it does most of the heavy lifting and authentication for you.
Last updated
Our Flutter SDK offers the easiest way to integrate Cotter's Sign In with Device. You can simply call a function and it does most of the heavy lifting and authentication for you.
Last updated
Concepts: Learn about how works.
There are major updates planned for this feature. so we can help you prepare for it.
Add Cotter to your pubspec.yaml
, then run flutter pub get
.
Import Cotter in your lib/main.dart
, then initialize it inside HomePageState
.
To verify the user's email or phone number, follow this guide after you've finished this one.
If the user logged-in from a trusted device, their login request will automatically be approved.
If the user logged-in from a different device that is not trusted, they will be presented with a prompt asking them to approve the login from their trusted phone inside your app. We'll cover this in the next guide.
Checkout how to verify the OAuth Tokens from Cotter here:
You can also verify your user's email or phone number during the sign up process.
Cotter's SDK automatically saves the logged-in user in your device's secure storage. Check out how to get the user information:
Cotter also automatically generates an access_token
, id_token
, and refresh_token
that is securely stored in the device's secure storage. Check how to get these tokens:
Check the latest releases in . You may need to restart your flutter for it to run pod install (stop flutter run and re run it).
For Android: Update minSdkVersion
to 18
.
You can to get your API_KEY_ID
.
Make sure you allow Trusted Devices Method in the .
To sign up, call cotter.signUpWithDevice
and input the user's email. This will create a new user in Cotter and trust the current device to allow logins. This function returns the .
To sign in, call cotter.signInWithDevice
. If the user is logging-in from a device that they trust, they'll automatically be approved. This function returns the .