Skip to content

Latest commit

 

History

History
57 lines (43 loc) · 1.08 KB

auth.md

File metadata and controls

57 lines (43 loc) · 1.08 KB

Authentication

Documentation on how to configure and use AI Warp's authentication.

Configuring

Configuring authentication can be done via your Platformatic config file under the auth object. E.g.

// platformatic.json
{
  "auth": {
    // ...
  }
}

We utilize fastify-user to do authentication, so you can pass in any configuration options for it in the auth object.

AI Warp-specific options:

  • required (boolean) - If true, any unauthenticated users will receive a 401 status code and body.

Example

This makes authentication required and accepts JWTs signed with the secret abc123:

{
  "auth": {
    "required": true,
    "jwt": {
      "secret": "abc123"
    }
  }
}

Using

By default, fastify-user reads the Authorization header.

You can configure AI Warp to read the token from cookies in your Platformatic config:

{
  "auth": {
    "jwt": {
      "cookie": {
        "cookieName": "token",
        "signed": false
      }
    }
  }
}