Introducing a new way to review your PRs.

Read the announcement

getredash / redash

Make Your Company Data Driven. Connect to any data source, easily visualize, dashboard and share your data.

View on GitHub

20 documents · Updated Nov 11, 2026

docs / identity-access-and-tenancy

Identity, access, and tenancy

Redash connects each request to an organization and an authenticated identity before it serves shared analytics resources. The system then combines organization membership, group capabilities, object access, and request security checks to control both interactive use and API access.

Organization tenancy

Organization context

An organization is the tenant boundary for users, groups, data sources, queries, dashboards, and related activity. Each organization has a unique slug and its own settings, including which login methods are available. In multi-organization mode, the URL carries the organization slug; in single-organization mode, the system uses the default context. redash/…/organizations.py• L13-25 redash/…/__init__.py• L137

The organization also owns the built-in default and admin groups. New users enter through the default group, while administrative power comes from membership in the admin group. Organization settings can override the shared authentication defaults for that tenant. redash/…/organizations.py• L38-40 redash/…/organizations.py• L60-78

References: redash/…/organizations.py• L13-25 redash/…/organizations.py• L38-40 redash/…/organizations.py• L60-78 redash/…/__init__.py• L137

Request scope

The request scope is resolved before the application looks up the current user. The system reads the organization slug from the route or request context, resolves the organization, and then uses that organization for identity and resource lookups. Organization-aware lookups reject objects outside the active tenant. redash/…/org_resolving.py• L9-20 redash/…/mixins.py• L20-28

This relationship keeps authentication and authorization aligned with tenancy. A valid user or API key in one organization does not by itself grant access to an object in another organization.

The request path determines the tenant before the identity is used for access checks:

flowchart LR
    A[Request] --> B[Resolve organization]
    B --> C[Load interactive user or API identity]
    C --> D[Check organization membership]
    D --> E[Apply permissions to resource]

References: redash/…/org_resolving.py• L9-20 redash/…/mixins.py• L20-28 redash/…/base.py• L28-42

Authentication

Interactive sign-in

Interactive sign-in creates a session for a user who belongs to the current organization. Password login checks the organization’s setting, the user’s password, and the disabled state. Invitation, email verification, and password reset links complete account setup without exposing account state through the login response. redash/…/authentication.py• L145-220 redash/…/account.py• L14-41

External sign-in methods use the same account boundary. After a provider identifies a person, Redash finds or creates the matching organization user and assigns the default group. A disabled account cannot complete this path. redash/…/__init__.py• L272-299

References: redash/…/authentication.py• L145-220 redash/…/account.py• L14-41 redash/…/__init__.py• L272-299

Authentication providers

The system supports local passwords and several external identity paths. Google OAuth can limit entry by organization domain or existing membership. SAML and LDAP can provision users from enterprise identity systems. A trusted reverse proxy can provide a remote user header. JWT can authenticate requests from a configured cookie or header after claim and signature checks. redash/…/google_oauth.py• L16-29 redash/…/saml_auth.py• L109-146 redash/…/ldap_auth.py• L32-69 redash/…/remote_user_auth.py• L19-49 redash/…/__init__.py• L165-200

Provider-specific setup and trust rules are described in Authentication providers.

References: redash/…/__init__.py• L272-299 redash/…/google_oauth.py• L16-29 redash/…/saml_auth.py• L109-146 redash/…/ldap_auth.py• L32-69 redash/…/remote_user_auth.py• L19-49 redash/…/__init__.py• L165-200

API identity

API access uses an API key supplied in the request query, authorization header, or token route. The key resolves to a user or to an object-scoped API identity. Disabled users are rejected, while object-scoped keys remain limited to the object and access type they represent. redash/…/__init__.py• L109-136 redash/…/__init__.py• L139-162

JWT is an additional request identity path. Redash validates the token against configured issuer, audience, algorithms, and public keys, then maps the token email to the user in the active organization. redash/…/__init__.py• L165-200 redash/…/jwt_auth.py• L58-82

References: redash/…/__init__.py• L109-136 redash/…/__init__.py• L139-200 redash/…/jwt_auth.py• L58-82

Session lifecycle

The session layer keeps interactive identity across requests and exposes the active user, groups, permissions, and organization slug to the client. Changes to a user’s email or password refresh that user’s current session and invalidate other sessions. Sign-in events include the organization, identity, client address, and user agent for later review. redash/…/authentication.py• L252-255 redash/…/authentication.py• L323-345 redash/…/__init__.py• L203-214

References: redash/…/authentication.py• L252-255 redash/…/authentication.py• L323-345 redash/…/__init__.py• L203-214 redash/…/__init__.py• L78-92

User and group management

User lifecycle

An organization admin invites a user into the default group. The user becomes active after account setup or external sign-in. Administrators can resend invitations, reset passwords, regenerate API keys, disable accounts, and re-enable accounts. Activated users are disabled instead of deleted so their identity and access history remain stable. redash/…/users.py• L130-158 redash/…/users.py• L161-192 redash/…/users.py• L276-322

Each user belongs to one organization and has one or more group memberships. The default group is retained when external group assignments are applied. The user’s enabled state controls whether later session and API-key resolution can load the account. redash/…/users.py• L77-105 redash/…/users.py• L115-126 redash/…/users.py• L225-230

References: redash/…/users.py• L130-158 redash/…/users.py• L77-105 redash/…/users.py• L115-126 redash/…/users.py• L225-230

Group membership

Groups provide the main way to manage access for a set of users. Built-in groups define the base and administrative roles. Regular groups can be created, renamed, assigned to users, and removed by administrators. Users can view only the groups they belong to unless they have administrative access. redash/…/users.py• L245-300 redash/…/groups.py• L9-69

Group membership is also the link between people and data sources. An administrator can attach a group to a data source and set that group’s data-source access to view-only or modify-capable. This lets one membership rule control access to many resources. redash/…/groups.py• L72-97 redash/…/groups.py• L123-195

References: redash/…/users.py• L130-158 redash/…/users.py• L161-192 redash/…/users.py• L276-322 redash/…/users.py• L77-105 redash/…/users.py• L115-126 redash/…/users.py• L225-230 redash/…/users.py• L245-300 redash/…/groups.py• L9-69 redash/…/groups.py• L72-97 redash/…/groups.py• L123-195

Authorization

Capability permissions

Capability permissions answer whether a user may perform a system action. A user receives the union of the permissions on the user’s groups. Resource handlers require these capabilities for actions such as listing users, managing groups, or performing administrative work. redash/…/users.py• L63-74 redash/…/users.py• L172-175 redash/permissions.py• L57-91

The admin permission is a broad organization-level override for resource access. The super-admin permission is a separate capability for operations that require that higher role. Ownership can also satisfy selected user and object management checks. redash/permissions.py• L34-49 redash/permissions.py• L94-109

References: redash/…/users.py• L63-74 redash/…/users.py• L172-175 redash/permissions.py• L34-49 redash/permissions.py• L57-91 redash/permissions.py• L94-109

Object permissions

Object permissions answer whether a user or key may view, modify, or delete a specific query or dashboard. An owner or admin can grant access to another organization user. The system records the grantor, grantee, object, and access type so the permission can be listed, checked, or revoked. redash/permissions.py• L10-14 redash/…/permissions.py• L21-104

For ordinary users, access is based on the groups attached to the object and the groups attached to the user. A matching group can grant view-only access or stronger access. API identities use a narrower object-key path that does not inherit ordinary user permissions. redash/permissions.py• L17-49

References: redash/permissions.py• L10-14 redash/permissions.py• L17-49 redash/…/permissions.py• L21-104 redash/…/users.py• L303-374

Data-source access

Data-source access is a group-level boundary that limits which data sources a user can discover and use. The group-to-data-source relation also carries the view-only flag, so downstream query access can distinguish read access from stronger access. redash/…/__init__.py• L176-190 redash/…/__init__.py• L258-305

This boundary works with object permissions rather than replacing them. A user must have the right organization, group reach, and action permission for the resource being used.

References: redash/…/__init__.py• L176-190 redash/…/__init__.py• L258-305 redash/…/groups.py• L123-195

Security controls

Request protection

The application protects browser sessions with signed cookies, session lifetime limits, secure-cookie options, and optional HTTPS enforcement. CSRF checks protect state-changing browser requests when enabled. The security layer also applies transport and browser policies such as HSTS, content security policy, referrer policy, and frame controls. redash/security.py• L23-70 redash/…/__init__.py• L58-92 redash/…/__init__.py• L101-130

References: redash/security.py• L23-70 redash/…/__init__.py• L58-92 redash/…/__init__.py• L101-130

Redirect targets after sign-in are restricted to safe local paths. This prevents a login flow from becoming an external redirect while still allowing a user to return to the requested Redash page. redash/…/__init__.py• L302-370

References: redash/security.py• L23-70 redash/…/__init__.py• L58-92 redash/…/__init__.py• L101-130 redash/…/__init__.py• L302-370

Trust boundaries

External identity providers and reverse proxies are trusted inputs. SAML assertions, JWT claims, Google profiles, LDAP results, and remote-user headers must be tied to the active organization before they create or load a user. The remote-user path needs a trusted front end that removes or overwrites the identity header; otherwise a caller could choose another user’s identity. redash/…/__init__.py• L161-183 redash/…/google_oauth.py• L120-137 redash/…/jwt_auth.py• L58-80

References: redash/…/__init__.py• L161-183 redash/…/google_oauth.py• L120-137 redash/…/jwt_auth.py• L58-80

Audit trail

Security-sensitive account and access actions produce events with organization and actor context. The event path treats API identities separately from interactive users, which keeps key-based activity attributable to its key or object scope. redash/…/base.py• L41-61 redash/…/users.py• L155-158 redash/…/groups.py• L81-89 redash/…/permissions.py• L54-65

References: redash/…/base.py• L41-61 redash/…/users.py• L155-158 redash/…/groups.py• L81-89 redash/…/permissions.py• L54-65

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep organization-scoped routes, current-organization resolution, and get_by_id_and_org lookups aligned. A route that drops the organization scope can cross the tenant boundary.
  • Keep every authentication provider’s identity mapping consistent with user creation, default-group assignment, disabled-account checks, and session creation.
  • When group permission names change, update the group defaults, capability guards, client session data, and any administrative workflow that depends on those names.
  • When access types or object-permission rules change, review both the grant/revoke API and the checks used by interactive users and API identities.
  • When session or API-key behavior changes, review key regeneration, disabled-user rejection, CSRF handling, cookie settings, and audit events as one contract.
  • When remote-user or JWT trust settings change, review the proxy or token issuer contract as well as the organization-level login settings.

Important failure modes

TriggerConsequenceGuard
A request uses the wrong or missing organization slugThe user is sent to the wrong login context or an organization-scoped lookup failsResolve the organization before identity lookup and use organization-aware object queries
A disabled user keeps an old session or API keyThe account could continue to access protected resourcesUser loading and API-key lookup reject disabled users; disable accounts through the admin path
A remote-user header reaches the backend from an untrusted callerA caller can log in as an arbitrary email identityPut Redash behind a trusted front end and remove or overwrite the identity header
An external provider maps a person to an organization without its access ruleAn unauthorized person can be provisioned or signed inApply provider-specific domain, assertion, token, or directory checks before account creation
A group or permission change is applied only to the UIThe client shows an action that the server still denies, or a server path lacks the intended guardTreat server permission checks and client session permission data as one contract
An object API key is treated as a normal user identityA key can reach resources outside its intended object scopeKeep object-key checks on the object API-key path and allow only the supported access type

Key files

FileWhy to read it
redash/…/__init__.pyCentral identity loading, session creation, API-key handling, JWT entry, and safe redirects
redash/…/org_resolving.pyOrganization selection for each request
redash/…/authentication.pyBrowser login, account recovery, session response, and organization login settings
redash/…/organizations.pyTenant settings and built-in organization groups
redash/…/users.pyUser state, group membership, effective permissions, API users, and object grants
redash/permissions.pyCapability, ownership, group, and object access decisions
redash/…/users.pyInvitation, user administration, disablement, and API-key management
redash/…/groups.pyGroup membership and data-source access administration
redash/…/permissions.pyQuery and dashboard grant, revoke, list, and check operations
redash/security.pyCSRF, cookie, transport, and browser security controls
redash/…/__init__.pyGlobal authentication, session, cookie, transport, and external identity settings
redash/…/organization.pyOrganization-level authentication provider and permission-control settings
redash/…/api.pyOrganization-scoped API route registration for users, groups, and access control