OIDC Single Sign-On
Teable supports OIDC single sign-on, allowing you to easily integrate Teable with external systems for user authentication and authorization.
Environment Variables Configuration
To enable OIDC integration in Teable, set the following environment variables in your .env file:
Configuration Details
BACKEND_OIDC_CLIENT_ID
: Client ID provided by the OIDC provider for Teable.BACKEND_OIDC_CLIENT_SECRET
: Client secret provided by the OIDC provider for Teable.BACKEND_OIDC_CALLBACK_URL
: Teable’s callback URL. Set to https://app.teable.io/api/auth/oidc/callback. Ensure this matches the callback URL registered with your OIDC provider.BACKEND_OIDC_USER_INFO_URL
: Endpoint URL for retrieving user information from the OIDC provider.BACKEND_OIDC_TOKEN_URL
: Endpoint URL for obtaining access tokens from the OIDC provider.BACKEND_OIDC_AUTHORIZATION_URL
: Endpoint URL where users authenticate with the OIDC provider.BACKEND_OIDC_ISSUER
: Identifier URL of the OIDC provider.BACKEND_OIDC_OTHER
: Additional OIDC configuration options in JSON format. In this example, we request “email” and “profile” scopes.
Enabling OIDC Authentication in Teable
To enable OIDC as an authentication method in Teable, include “oidc” in the SOCIAL_AUTH_PROVIDERS
environment variable:
This allows users to authenticate in Teable using OIDC, GitHub, and Google.
Important Notes
- Ensure all URLs use HTTPS protocol for security.
- Never hardcode these sensitive details directly into the Teable application in production. Always use environment variables or secure key management systems.
- Specific URLs and configurations may vary depending on your chosen OIDC provider (such as Google, Okta, Auth0, etc.). Refer to your OIDC provider’s documentation for accurate endpoint URLs and configuration requirements.
- When setting BACKEND_OIDC_OTHER, you may need to add additional parameters based on your requirements and OIDC provider support.
- The example in .env.example uses Google as the OIDC provider. If you use a different provider, make sure to update the URLs accordingly.
With proper configuration of these environment variables, your Teable application should successfully integrate OIDC authentication. If you encounter any issues, check your OIDC provider documentation and ensure all URLs and credentials are correct.
Example: Using Authentik as OIDC Provider
Follow these steps to configure Authentik as an OIDC provider for your Teable application:
- Log in to your Authentik admin panel and create a new OAuth2 Provider.
- In the OAuth2 Provider settings, set the redirect URI to match your
BACKEND_OIDC_CALLBACK_URL
. The format should be:
- After creating the OAuth2 Provider, you need to map Authentik configuration to Teable environment variables. Use the following correspondence:
- Client ID →
BACKEND_OIDC_CLIENT_ID
- Userinfo URL →
BACKEND_OIDC_USER_INFO_URL
- Token URL →
BACKEND_OIDC_TOKEN_URL
- Authorize URL →
BACKEND_OIDC_AUTHORIZATION_URL
- OpenID Configuration Issuer →
BACKEND_OIDC_ISSUER
- Client ID →
- Generate a client secret in Authentik and set it as
BACKEND_OIDC_CLIENT_SECRET
in Teable environment variables. - Update your Teable
.env
file with these values. Your configuration should look something like this:
Remember to replace your-teable-domain.com
and your-authentik-domain.com
with your actual domain names.
Following these steps, you should have successfully configured Authentik as an OIDC provider for your Teable application. Make sure to restart your Teable application after updating the environment variables for the changes to take effect.