Getting the Tokens
Getting an access token from Cotter's SDK is as easy as setting a variable to `true`.
Getting Cotter's OAuth Tokens is very easy using our current authentication methods. You should automatically receive the oauth_token whenever a user is succesfully authenticated, either using magic link, OTP, trusted device, or WebAuthn.
You will get an oauth_token object in the JSON response with all the tokens:
1
{
2
...
3
"oauth_token": {
4
"access_token": "eyJhbGciOiJFUzI1sInR5cC...",
5
"auth_method": "TRUSTED_DEVICE", // authentication method used
6
"expires_in": 3600, // expiry in seconds
7
"id_token": "eyJhbGciOiJFUz...",
8
"refresh_token": "60:79hbLxl3aTjWWgCcIRnn...",
9
"token_type": "Bearer"
10
}
11
}
Copied!

Getting Tokens using the SDK

There are 3 places in the existing SDK where you can receive access tokens:

Getting Tokens using HTTP Request

You can also call Cotter's API to get the tokens.
​
Last modified 1yr ago