Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document basic HTTP authentication #7045

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion docs/Reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,11 @@ Starting in API v8, we've improved error formatting in form error responses. The

## Authentication

Authenticating with the Discord API can be done in one of two ways:
Authenticating with the Discord API can be done in one of three ways:

1. Using a bot token found on the **Bot** page within your app's settings. For more information on bots see [bots vs user accounts](#DOCS_TOPICS_OAUTH2/bot-vs-user-accounts).
2. Using an OAuth2 bearer token gained through the [OAuth2 API](#DOCS_TOPICS_OAUTH2/oauth2).
3. Using basic authentication with a client ID and client secret found on the **OAuth2** page within your app's settings in the format `client_id:client_secret` as a Base64 encoded string. Only applicable for the [OAuth2 API](#DOCS_TOPICS_OAUTH2/shared-resources-oauth2-urls) token endpoints.

For all authentication types, authentication is performed with the `Authorization` HTTP header in the format `Authorization: TOKEN_TYPE TOKEN`.

Expand All @@ -120,6 +121,12 @@ Authorization: Bot MTk4NjIyNDgzNDcxOTI1MjQ4.Cl2FMQ.ZnCjm1XVW7vRze4b7Cq4se7kKWs
Authorization: Bearer CZhtkLDpNYXgPH9Ml6shqh2OwykChw
```

###### Example Basic Token Authorization Header

```
Authorization: Basic MTk4NjIyNDgzNDcxOTI1MjQ4OlEzS052N0NSRW5DYS1nS0xMajFEOGV1ZFl1SmZ1Nm96
```

## Encryption

All HTTP-layer services and protocols (e.g. HTTP, WebSocket) within the Discord API are using TLS 1.2.
Expand Down