Single-Sign-On (SSO)
Kublade supports Single-Sign-On (SSO) through various social providers, allowing users to authenticate using their existing social media accounts. This guide explains how to configure and use SSO in your Kublade instance.
Prerequisites
- A Kublade instance with user management enabled
- Valid accounts with the social providers you want to use
- Matching email addresses between social accounts and Kublade user accounts
Configuration
Environment Variables
To enable SSO, you need to configure the following environment variables in your .env
file:
# GitHub Configuration
GITHUB_ENABLED=false
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
# GitLab Configuration
GITLAB_ENABLED=false
GITLAB_CLIENT_ID=
GITLAB_CLIENT_SECRET=
# Bitbucket Configuration
BITBUCKET_ENABLED=false
BITBUCKET_CLIENT_ID=
BITBUCKET_CLIENT_SECRET=
# Google Configuration
GOOGLE_ENABLED=false
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
# Azure Configuration
AZURE_ENABLED=false
AZURE_CLIENT_ID=
AZURE_CLIENT_SECRET=
AZURE_TENANT_ID=
AZURE_PROXY=
# Slack Configuration
SLACK_ENABLED=false
SLACK_CLIENT_ID=
SLACK_CLIENT_SECRET=
Setting Up Social Providers
For each provider you want to enable, follow these steps:
-
Create OAuth Application
- Go to the provider's developer portal
- Create a new OAuth application
- Set the callback URL to:
https://your-kublade-domain/auth/{provider}/callback
- Copy the Client ID and Client Secret
-
Configure Environment Variables
- Set
{PROVIDER}_ENABLED=true
- Add the Client ID and Client Secret
- For Azure, also configure the Tenant ID and Proxy if needed
- Set
Usage
User Requirements
Important: For SSO to work, the following conditions must be met:
- The user must already exist in the Kublade system
- The email address used in the social provider account must match the email address in the Kublade user account
- The social provider must be properly configured and enabled
Login Process
- Click the "Login with {Provider}" button on the login page
- You will be redirected to the provider's login page
- After successful authentication, you will be redirected back to Kublade
- If the email addresses match, you will be automatically logged in
Troubleshooting
Common issues and solutions:
-
Login Fails
- Verify that the user exists in Kublade
- Check if email addresses match exactly
- Ensure the social provider is properly configured
- Check the application logs for detailed error messages
-
Provider Not Available
- Verify that the provider is enabled in the
.env
file - Check if all required credentials are set
- Ensure the callback URL is correctly configured in the provider's settings
- Verify that the provider is enabled in the
Security Considerations
- Keep your Client Secrets secure and never commit them to version control
- Regularly rotate your OAuth credentials
- Monitor login attempts and implement rate limiting if necessary
- Consider implementing additional security measures like IP restrictions