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
Copy file name to clipboardExpand all lines: src/connections/sources/catalog/libraries/server/http-api/index.md
+31Lines changed: 31 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,10 @@ Segment has native [sources](/docs/connections/sources/) for most use cases (lik
11
11
12
12
### Authentication
13
13
14
+
Choose between [basic authentication](#basic-authentication) and [OAuth](#oauth) to authenticate requests.
15
+
16
+
#### Basic authentication
17
+
14
18
Authenticate to the Tracking API by sending your project's **Write Key** along with a request.
15
19
Authentication uses HTTP Basic Auth, which involves a `username:password` that is base64 encoded and prepended with the string `Basic`.
16
20
@@ -19,6 +23,33 @@ In practice that means taking a Segment source **Write Key**,`'abc123'`, as the
19
23
> info ""
20
24
> Include a colon before encoding. While encoding the write key without a colon might work due to backward compatibility, this won't always be the case.
21
25
26
+
#### OAuth
27
+
[Obtain the access token](/docs/connections/oauth/) from the Authorization Server specific to the region.
28
+
29
+
Include the access token in the Authorization header as a Bearer token along with your project's write key in the payload of the request. For example, Authorization with Bearer token looks like:
30
+
31
+
```
32
+
Authorization: Bearer <access token>
33
+
```
34
+
35
+
36
+
For example, to use the access token in the HTTP API Source, use `access_token` in the header and `write_key` in the payload. An example cURL request looks like:
0 commit comments