Self-hosted Auth Provider Overview

The term "Auth Provider" refers to the TinaCMS component that handles authentication and authorization of users when self-hosting.

The recommended auth provider for TinaCMS is based on Auth.js. It leverages a user collection in your database to store user information and uses the Auth.js api to handle authentication and authorization. By leveraging Auth.js, you can also easily add support for any Auth.js Login Provider such as Auth0, GitHub, Google, etc.

The auth provider is configured in two places when self-hosting:

  • The TinaCMS Config
  • The TinaCMS Backend

1. TinaCMS Config (tina/config.ts,tsx,js)

This is done by providing an Auth Provider to the authProvider option in defineConfig.

Example:

2. TinaCMS Backend

/api/tina/[...routes].{ts,js}

Pre-Built Auth Providers

Implementing an Auth Provider

See Custom Auth Provider for more information on how to implement your own auth provider.

Last Edited: November 7, 2024