AUTH_TYPE in your .env file and, for SSO providers, supplying the relevant credentials. Only one primary auth type is active at a time.
Auth types
AUTH_TYPE value | Description |
|---|---|
basic | Email address + password, managed by Onyx |
google_oauth | Sign in with Google |
oidc | OpenID Connect (Okta, Keycloak, Entra ID, and others) |
saml | SAML 2.0 (Okta, Azure AD, and others) |
cloud | Google OAuth and basic auth, used by Onyx Cloud |
Email and password (basic)
AUTH_TYPE=basic is the default. Users register with an email address and password that Onyx stores and manages.
Relevant .env settings
Password requirements
You can enforce password complexity rules with these variables:Email verification
To require new users to verify their email address before they can log in:Invite-only vs. open registration
By default, any user with a valid email address can create an account. To restrict registration:- Domain allowlist: Set
VALID_EMAIL_DOMAINS=yourdomain.com(comma-separated for multiple domains). Only addresses from listed domains can register. - Invite-only: Enable
ENABLE_EMAIL_INVITES=trueand send invites from Settings → Users → Invite Users. Users without an invitation link cannot register.
Google OAuth
AUTH_TYPE=google_oauth delegates all authentication to Google. Users sign in with their Google account.
Create a Google OAuth app
Go to Google Cloud Console → APIs & Services → Credentials → Create Credentials → OAuth 2.0 Client ID.Set the application type to Web application. Add your Onyx domain to the Authorized redirect URIs:
GOOGLE_OAUTH_CLIENT_ID and GOOGLE_OAUTH_CLIENT_SECRET are accepted as aliases for backwards compatibility, but OAUTH_CLIENT_ID / OAUTH_CLIENT_SECRET are preferred.OpenID Connect (OIDC)
AUTH_TYPE=oidc works with any OIDC-compliant identity provider: Okta, Keycloak, Microsoft Entra ID (Azure AD), Auth0, and others.
Create an OIDC application in your identity provider
The exact steps vary by provider, but you will need to:
- Set the application type to Web or OIDC Web App
- Add the Onyx callback URL as an allowed redirect URI:
- Note the Client ID, Client Secret, and the OpenID configuration URL (sometimes called the discovery URL or well-known URL).
Scope overrides
If your OIDC provider requires additional scopes (for example, to pass tokens to connector tools), specify them as a comma-separated list:SAML
AUTH_TYPE=saml uses SAML 2.0. This requires a SAML configuration directory with your IdP metadata.
Place IdP metadata in the config directory
Mount the SAML config directory into the backend container. At minimum, the directory must contain your IdP’s metadata XML file. Refer to your IdP documentation for how to export the metadata.
API key authentication
API keys allow programmatic access to Onyx without a browser session. They are useful for integrations, bots, and scripts.Creating an API key
Open API keys settings
Go to Settings → API Keys (admin panel) or your personal Profile → API Keys for user-scoped keys.
Using an API key in requests
Include the key as a Bearer token in theAuthorization header:
API keys are scoped to the user who created them and inherit that user’s permissions. Admin-created keys under Settings → API Keys can be assigned to service accounts with specific roles.
Anonymous access
Anonymous access allows unauthenticated users to interact with a designated public assistant without logging in. This is disabled by default. To enable anonymous access, go to Settings → Workspace Settings and toggle on Allow Anonymous Access. You can then configure which assistant anonymous users see and what knowledge sources they have access to.Session management
| Variable | Default | Description |
|---|---|---|
SESSION_EXPIRE_TIME_SECONDS | 604800 (7 days) | How long a session stays valid |
AUTH_COOKIE_EXPIRE_TIME_SECONDS | 604800 (7 days) | How long the auth cookie is valid in the browser |
TRACK_EXTERNAL_IDP_EXPIRY | false | Force re-auth when the identity provider token expires |
User roles
Onyx has five user-facing roles:| Role | Permissions |
|---|---|
| Admin | Full access to all admin settings, connectors, and user management |
| Global Curator | Can manage all user groups they belong to |
| Curator | Can manage specific user groups they have been assigned as curator |
| Basic | Standard user — can chat, search, and use connectors shared with them |
| Limited | Restricted access to a limited subset of API endpoints |
