From 0146f16d77b6ae2dae1e919ffa4c2429b989d3c9 Mon Sep 17 00:00:00 2001 From: Baylee Schmeisser Date: Fri, 20 Sep 2024 15:50:37 -0700 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=92=82=20Add=20better=20description?= =?UTF-8?q?=20for=20authentication.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api-playground/mdx/authentication.mdx | 60 +++++++++++++++++++-------- 1 file changed, 42 insertions(+), 18 deletions(-) diff --git a/api-playground/mdx/authentication.mdx b/api-playground/mdx/authentication.mdx index 58dbc9701..8233c55fc 100644 --- a/api-playground/mdx/authentication.mdx +++ b/api-playground/mdx/authentication.mdx @@ -9,6 +9,8 @@ You can add an authentication method to your mint.json to enable it on every pag The page's authentication method will override mint.json if both are set. +### Bearer Token + ```json mint.json @@ -28,36 +30,58 @@ authMethod: "bearer" -## Supported Authentication Methods - -- bearer -- basic -- none - -The "none" authentication method is useful to disable authentication on a specific endpoint after setting a default in mint.json. - -## Authentication Name +### Basic Authentication -By default, basic authentication asks for username and password. However, basic authentication can use a different name for username and password. For example, you could have called it `user-id:user-key`. - -You can set the name property in mint.json to override the default functionality. Use colons to separate each property you want to request. + -```json Custom username and password +```json mint.json "api": { "auth": { - "method": "basic", - "name": "user-id:user-key" + "method": "basic" } } ``` -You can also request a single API key by excluding the colon. +```md page metadata +--- +title: "Your page title" +authMethod: "basic" +--- +``` + + -```json Custom username and password +### API Key + + + +```json mint.json "api": { "auth": { "method": "key", - "name": "my-api-key" + "name": "x-api-key" } } ``` + +```md page metadata +--- +title: "Your page title" +authMethod: "key" +--- +``` + + + +### None + +The "none" authentication method is useful to disable authentication on a specific endpoint after setting a default in mint.json. + + +```md page metadata +--- +title: "Your page title" +authMethod: "none" +--- +``` + From 2a2fad0d181e887f70b8584b4f8f13c8af2b1f7b Mon Sep 17 00:00:00 2001 From: Baylee Schmeisser Date: Mon, 23 Sep 2024 14:56:52 -0700 Subject: [PATCH 2/2] caps page metadata. --- api-playground/mdx/authentication.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api-playground/mdx/authentication.mdx b/api-playground/mdx/authentication.mdx index 8233c55fc..b6469ecb7 100644 --- a/api-playground/mdx/authentication.mdx +++ b/api-playground/mdx/authentication.mdx @@ -21,7 +21,7 @@ The page's authentication method will override mint.json if both are set. } ``` -```md page metadata +```md Page Metadata --- title: "Your page title" authMethod: "bearer" @@ -42,7 +42,7 @@ authMethod: "bearer" } ``` -```md page metadata +```md Page Metadata --- title: "Your page title" authMethod: "basic" @@ -64,7 +64,7 @@ authMethod: "basic" } ``` -```md page metadata +```md Page Metadata --- title: "Your page title" authMethod: "key" @@ -78,7 +78,7 @@ authMethod: "key" The "none" authentication method is useful to disable authentication on a specific endpoint after setting a default in mint.json. -```md page metadata +```md Page Metadata --- title: "Your page title" authMethod: "none"