Skip to content

Commit

Permalink
Authentication delete duplicated page and update content (#221)
Browse files Browse the repository at this point in the history
  • Loading branch information
seanparkross authored Nov 28, 2023
1 parent 9253eae commit 31161c7
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 129 deletions.
101 changes: 0 additions & 101 deletions docs/auth/authentication/auth-config.mdx

This file was deleted.

64 changes: 37 additions & 27 deletions docs/auth/authentication/index.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
sidebar_position: 1
sidebar_position: 2
sidebar_label: Auth Config
description: Get detailed guidance on setting up Hasura authentication for incoming requests. Uncover the structure of the AuthConfig metadata object supporting JWT and webhook methods.
description: "Get detailed guidance on setting up Hasura authentication for incoming requests. Uncover the structure
of the AuthConfig metadata object supporting JWT and webhook methods."
keywords:
- hasura authconfig
- hasura authentication setup
Expand Down Expand Up @@ -42,11 +43,11 @@ This document details the `AuthConfig` metadata object used to set up authentica

Only a single `AuthConfig` object can be defined in the metadata. It has the following structure:

| Field | Type | Required | Description |
| ----------------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------ |
| `allowRoleEmulationFor` | String | false | Name of the role which allows role emulation. Read more about role emulation [here](./role-emulation.mdx). |
| `webhook` | Object | false | Configuration of the authentication webhook. |
| `jwt` | Object | false | Configuration of the JWT secret. |
| Field | Type | Required | Description |
|------------------------|--------|----------|--------------------------------------------------------------------------------------------------------------------------|
| `allowRoleEmulationBy` | String | false | Name of the role which allows role emulation. Read more about role emulation [here](./role-emulation.mdx). |
| `webhook` | Object | false | Configuration of the authentication webhook. |
| `jwt` | Object | false | Configuration of the JWT secret. |

:::info You must select one of the supported authentication modes

Expand All @@ -58,14 +59,22 @@ In the object, only one of the supported authentication modes (`jwt` or `webhook

### Example

```json
{
"kind": "AuthConfig",
"jwt": {
"type": "HS256",
"key": "<JWT Decoding key>"
}
}
```yaml
kind: AuthConfig
version: v1
definition:
jwt:
key:
fixed:
algorithm: HS256
key:
value: token
tokenLocation:
type: BearerAuthorization
claimsConfig:
namespace:
claimsFormat: Json
location: "/https:~1~1hasura.io~1jwt~1claims"
```
For a full description of JWT mode [see here](./jwt.mdx).
Expand All @@ -74,19 +83,20 @@ For a full description of JWT mode [see here](./jwt.mdx).
### Example
```json
{
"kind": "AuthConfig",
"allowRoleEmulationFor": "admin",
"webhook": {
"webhookUrl": "http://auth.yourservice.com/validate-request"
}
}
```yaml
---
kind: AuthConfig
version: v1
definition:
allowRoleEmulationBy: admin
webhook:
url: http://auth.yourservice.com/validate-request
method: Get
```
| Field | Type | Required | Description |
| ------------ | ------ | -------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| `webhookUrl` | URL | true | URL of the authentication webhook. |
| `mode` | String | false | HTTP method to use while making the request to the authentication webhook. Only `GET` and `POST` methods are supported (default: `GET`). |
| Field | Type | Required | Description |
|----------|--------|----------|-------------------------------------------------------------------------------------------------------------------------|
| `url` | URL | true | URL of the authentication webhook. |
| `method` | String | false | HTTP method to use while making the request to the authentication webhook. Only `Get` and `Post` methods are supported. |

For a full description of webhook mode [see here](./webhook.mdx).
2 changes: 1 addition & 1 deletion docs/auth/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import Auth from "@site/static/icons/features/auth.svg";
<h4>Quick Links</h4>
<ul>
<li>
<VersionedLink to="/auth/authentication/auth-config/">Check out the AuthConfig metadata.</VersionedLink>
<VersionedLink to="/auth/authentication/">Check out the AuthConfig metadata.</VersionedLink>
</li>
<li>
<VersionedLink to="/auth/authentication/jwt/">Implement auth using JWT mode.</VersionedLink>
Expand Down

0 comments on commit 31161c7

Please sign in to comment.