diff --git a/api-playground/mdx/authentication.mdx b/api-playground/mdx/authentication.mdx index 58dbc9701..b6469ecb7 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 @@ -19,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" @@ -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" +--- +``` +