You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Access Tokens let backend systems securely grant users, devices, tenants, etc. access to SQLite Cloud database and services (SQLite Sync, Weblite, etc.). These endpoints enable full token lifecycle management: creation, inspection, validation, update, and revocation.
12
-
All endpoints require authentication. Use an **API Key** or an **Access Token** via the `Authorization` header.
11
+
Access Tokens let backend systems securely grant users, devices, tenants, etc. access to SQLite Cloud database and services (SQLite Sync, Weblite, etc.). These endpoints enable full token lifecycle management: creation, inspection, validation, update, and revocation. All endpoints require authentication. Use an **API Key** or an **Access Token** via the `Authorization` header.
13
12
14
-
---
15
-
16
-
## Create a New Access Token
17
-
18
-
### `POST /v2/tokens`
19
-
20
-
Creates a new Access Token for a specific user.
21
-
The `userId` refers to your user's id or any kind of resource you want to associate the Access Token to. It must be a unique ID in your system.
22
-
The `expiresAt` is a date time value to set expiration, or `null` if it doesn't expire.
23
-
24
-
>[!note] Store the Access Token securely. It will not be shown again.
API Documentation can be found in the **Weblite** section in the [Dashboard](https://dashboard.sqlitecloud.io).
58
14
59
15
---
60
16
61
-
## Get Current Token Details (Access Token Only)
62
-
63
-
### `GET /v2/tokens/details`
17
+
In the repository on GitHub [sqlitecloud/examples](https://github.com/sqlitecloud/examples), we created a simple app to demonstrate how to generate and use Access Tokens.
64
18
65
-
Retrieves metadata about the token used to authenticate the request.
19
+
We’ll log in with Google, grab a token, and use it to interact with SQLite Cloud Weblite APIs. Here’s how it works.
66
20
67
-
-**Authentication**: Access Token
21
+
## Generate a new Access Token
68
22
69
-
#### Example
23
+
In the snippet below, we handle the Google Login callback when the user has completed the login on Google. Here, you can exchange the `code` with the Google Access Token and then decide what to do with it as needed.
0 commit comments