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
The Prisma Postgres API supports two authentication methods:
40
+
41
+
-**Service tokens** — for accessing resources in your own workspace
42
+
-**OAuth 2.0 access tokens** — for accessing or managing resources on behalf of users
43
+
44
+
### Service tokens
41
45
42
-
The Prisma Postgres API uses _Bearer Token Authentication_ and supports two kinds of tokens:
43
-
- Service tokens (manually created in your [Prisma Console](https://console.prisma.io) workspace)
44
-
- OAuth 2 access tokens
46
+
Service tokens are manually created in your [Prisma Console](https://console.prisma.io) workspace. They're ideal for server-to-server integrations or provisioning databases in your own workspace.
45
47
46
-
To adhere to the Bearer Token Authentication, you need to format your `Authorization` header like this:
48
+
To authenticate with a service token, include it in the `Authorization` header:
47
49
48
50
```
49
51
Authorization: Bearer $TOKEN
50
52
```
51
53
52
54
#### Creating a service token
53
55
54
-
You can create a service token to use the Management API like this:
55
-
56
56
1. Open the [Prisma Console](https://console.prisma.io/).
57
57
2. Navigate to your workspace.
58
-
3. Navigate to the **Settings** page of your workspace and select **Service Tokens**.
59
-
4. Click **New Service Token**.
60
-
5. Copy the generated token and store it in a safe location for future use.
58
+
3. Go to the **Settings** page of your workspace and select **Service Tokens**.
59
+
4. Click **New Service Token** and copy the generated token for future use.
60
+
61
+
### OAuth 2.0 authentication
62
+
63
+
Use OAuth 2.0 if you want to act on behalf of users and create or manage databases directly in their workspaces.
61
64
62
65
#### Creating OAuth credentials
63
66
64
-
To obtain a client ID and client secret, go through this flow:
67
+
To obtain a client ID and client secret:
65
68
66
69
1. Open the [Prisma Console](https://console.prisma.io).
67
-
1. Click the 🧩 **Integrations** tab in the sidenav.
68
-
1. In the **Published Applications** section, click the **New Application** button to start creating a new OAuth app.
69
-
1. Enter a **Name**, **Description**, and **Callback URL** for your OAuth app.
70
-
1. Click **Continue**.
71
-
72
-
On the next screen, copy and store the client ID and client secret for your OAuth app in a secure location.
70
+
2. Click the 🧩 **Integrations** tab.
71
+
3. Under **Published Applications**, click **New Application**.
72
+
4. Enter a **Name**, **Description**, and **Callback URL**.
73
+
5. Click **Continue**, then copy and store your **Client ID** and **Client Secret**.
0 commit comments