From 858728c9984c7e17d73b2285f4bcf198bd9a20c3 Mon Sep 17 00:00:00 2001 From: ManHat Date: Thu, 1 Aug 2024 00:42:53 +0300 Subject: [PATCH 1/2] basic HTTP authentication --- docs/Reference.mdx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/Reference.mdx b/docs/Reference.mdx index 66384b02e5..7564812d20 100644 --- a/docs/Reference.mdx +++ b/docs/Reference.mdx @@ -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 client 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 URLs. For all authentication types, authentication is performed with the `Authorization` HTTP header in the format `Authorization: TOKEN_TYPE TOKEN`. @@ -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. From 2b6a76dfc47b4798f113a5a9aee1943397529ca3 Mon Sep 17 00:00:00 2001 From: ManHat Date: Thu, 1 Aug 2024 16:11:42 +0300 Subject: [PATCH 2/2] fix --- docs/Reference.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Reference.mdx b/docs/Reference.mdx index 7564812d20..dcbb7d474d 100644 --- a/docs/Reference.mdx +++ b/docs/Reference.mdx @@ -105,7 +105,7 @@ 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 client 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 URLs. +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`.