Cotter
Blog
Dashboard
Get help on Slack π
Searchβ¦
0.1.0
π
Getting Started
Features & Concepts
π
Quickstart Guides
All Guides & Tutorials
HTML β Sign in with Email/Phone
React β Sign in with Email/Phone
React β WebAuthn
β² Next.js
Angular
Webflow
Bubble.io
Python SDK for a CLI
React Native β Sign in with Device
iOS β Sign in with Device
Flutter β Sign in with Device
π
SDK Reference
Web
React Native
Flutter
Sign In with Device
Sign in with Email/Phone Number
Getting the Logged-in User
Getting OAuth Tokens
Signing a User Out
iOS
Android
Python (for CLI)
API for Other Mobile Apps or CLI
Backend: Handling Response
π‘οΈ Protecting Your Account
Only Allow Your Website/App to Use Your API Key
Rate Limit
Enable reCAPTCHA to Protect Against Automated Abuse
ποΈ Getting Access Token
Cotter's OAuth 2.0 Tokens Specification
Getting the Tokens
Storing and Removing Tokens
Renewing Expired Tokens
Verifying JWT Tokens
Requesting Custom Fields on your JWT Token
Older API
π
API Reference
User API
OAuth Tokens API
OAuth Tokens from Social Login
Event Object
Reset PIN API
Older API
Validating Cotter's Identity Token
Validating Cotter's Event Response
Powered By
GitBook
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
Cotter's OAuth 2.0 Tokens Specification
β
Previous
Getting the Logged-in User
Next
Signing a User Out
Last modified
1yr ago
Copy link
Contents
OAuth Token Specification