Getting OAuth Tokens
When a user successfully logged-in, Cotter will generate an access_token , an id_token , and a refresh_token that you can use in your backend API.
The SDK automatically stores these tokens in the device's secure storage.

Getting The Tokens

1
Cotter cotter = new Cotter(apiKeyID: API_KEY_ID);
2
try {
3
var accessToken = await cotter.getAccessToken();
4
var idToken = await cotter.getIDToken();
5
var refreshToken = await cotter.getRefreshToken();
6
} catch (e) {
7
print(e);
8
}
Copied!
This function will automatically refresh the access_token and id_token if it's expired.

OAuth Token Specification

​
Last modified 1yr ago
Copy link