Conduit
Conduit
Docsllms.txtHostingGitHubIntroduction

Getting Started

OverviewInstall ConduitMCP SetupYour First AppStart with AI

Learn

ArchitectureClient vs Admin APIConfiguration

Modules

OverviewAuthenticationAuthorizationDatabaseStorageCommunicationsChatRouterFunctions

Guides

Next.js IntegrationReBAC Team ScopingGitOps State Export

Deployment

Deployment OverviewDocker ComposeKubernetes and HelmLocal from SourceContainer Images

Reference

CLI ReferenceClient APIAdmin APIEnvironment VariablesMCP Tools

Resources

Migration v0.16 → v0.17Legacy DocumentationChangelogFAQGlossaryContributing

Authentication

Users, local/OAuth login, tokens, teams, and 2FA.

The authentication module handles user accounts, token issuance, OAuth providers, teams, magic links, and 2FA. Application runtime code uses the Client API with user bearer tokens; provisioning uses Admin API or MCP.

Use cases

User sign-up and login

Email/password or OAuth with JWT access and refresh tokens

Multi-tenant B2B

Teams with hierarchy, invites, and default team membership

Secure web apps

Server-side token vault — tokens never in browser storage

Back-office access

Admin-team role gates for operator-only Admin API routes

Capabilities

  • Local register/login
  • OAuth (Google, GitHub, Apple, …)
  • Access + refresh tokens
  • Magic link & 2FA
  • Teams & invites
  • Email verification
  • Password reset
  • User profile extension fields

Example: Register, login, and invite a teammate

Walkthrough

  1. Enable the authentication module and local strategy via MCP `patch_config_authentication`
  2. Register a user with POST /authentication/local/new
  3. Log in with POST /authentication/local and save accessToken server-side
  4. Create a team via MCP post_authentication_teams (admin) or Client API team routes
  5. Invite a teammate with an invitation token on register
Register
curl -X POST http://localhost:3000/authentication/local/new \
-H "Content-Type: application/json" \
-d '{"email":"dev@example.com","password":"SecurePass123!"}'
Login
curl -X POST http://localhost:3000/authentication/local \
-H "Content-Type: application/json" \
-d '{"email":"dev@example.com","password":"SecurePass123!"}'

How it works

Token lifecycle

Access tokens (default 1h) authenticate Client API requests. When refreshTokens.enabled is true, POST /authentication/renew rotates the refresh token and issues a new pair. Blocked users (active: false) cannot renew or log in.

Application token storage

Web / Next.js: Store { accessToken, refreshToken } in a server-side vault (Redis). The browser holds only an opaque session cookie. On 401, renew once and retry. See the Next.js guide.

Mobile: Platform secure storage (Keychain, SecureStore) when no server vault exists.

Never persist tokens in localStorage or sessionStorage.

Teams

Teams register as a built-in ReBAC resource (Team) with relations member, owner, and team-scoped permissions. Team routes on the Client API require authentication; admin CRUD uses MCP tools like get_authentication_teams and post_authentication_teams.

OAuth

When a provider is enabled in config, GET /authentication/init/{provider} redirects to the IdP. Callback hits /authentication/hook/{provider}; tokens return in JSON or httpOnly cookies depending on accessTokens.setCookie / refreshTokens.setCookie.

Configure

Patch module config via MCP patch_config_authentication:

KeyDefaultMeaning
accessTokens.expiryPeriod3600000 (1h)Access JWT lifetime (ms)
refreshTokens.enabledtrueEnable /authentication/renew
refreshTokens.expiryPeriod604800000 (7d)Refresh token lifetime
local.verification.requiredfalseRequire email verification before login
teams.enabledfalseEnable team routes and team-scoped ReBAC

OAuth providers need clientId + clientSecret per provider under config.{provider}.

Local and OAuth routes require router client id/secret in request context (Conduit router client credentials).

Client API

OperationPath
RegisterPOST /authentication/local/new
LoginPOST /authentication/local
RenewPOST /authentication/renew
LogoutPOST /authentication/logout
Current userGET /authentication/user
TeamsGET /authentication/teams, POST /authentication/teams, …

Register returns { user } only — the user must log in separately for tokens.

MCP

Enable with ?modules=authentication in your MCP server URL.

ToolPurpose
get_authentication_usersList users
post_authentication_usersCreate user (admin)
get_authentication_teamsList teams
post_authentication_teamsCreate team
patch_config_authenticationToken, OAuth, team settings

Next steps

  • Your first app
  • Next.js integration
  • Authorization (ReBAC)
  • ReBAC team scoping

Overview

Conduit Platform modules overview.

Authorization

ReBAC resources, relations, permissions, and scope.

On this page

Use casesCapabilitiesExample: Register, login, and invite a teammateHow it worksToken lifecycleApplication token storageTeamsOAuthConfigureClient APIMCP