casdoor
An open-source UI-first Identity and Access Management (IAM) / Single-Sign-On (SSO) platform with web UI supporting OAuth 2.0, OIDC, SAML, CAS, LDAP, SCIM, WebAuthn, TOTP, MFA, Face ID, RADIUS, Google Workspace, Active Directory and Kerberos
Top Related Projects
Open Source Identity and Access Management For Modern Applications and Services
Headless cloud-native authentication and identity management written in Go. Scales to a billion+ users. Replace Homegrown, Auth0, Okta, Firebase with better UX and DX. Passkeys, Social Sign In, OIDC, Magic Link, Multi-Factor Auth, SMS, SAML, TOTP, and more. Runs everywhere, runs best on Ory Network.
Open source alternative to Auth0 / Firebase Auth / AWS Cognito
๐งโ๐ The better auth and identity infrastructure and the open-source alternative to Auth0. No framework restrictions.
ZITADEL - Identity infrastructure, simplified forย you.
The Single Sign-On Multi-Factor portal for web apps
Quick Overview
Casdoor is an open-source Identity and Access Management (IAM) / Single-Sign-On (SSO) platform with web UI supporting OAuth 2.0, OIDC, SAML and CAS. It provides a comprehensive solution for user authentication, authorization, and management across multiple applications and services.
Pros
- Supports multiple authentication protocols (OAuth 2.0, OIDC, SAML, CAS)
- Offers a user-friendly web interface for easy management
- Integrates with various third-party identity providers (Google, GitHub, Facebook, etc.)
- Highly customizable and extensible
Cons
- Relatively new project, may have fewer community resources compared to more established IAM solutions
- Documentation could be more comprehensive for advanced use cases
- May require additional configuration for complex enterprise environments
- Limited built-in analytics and reporting features
Code Examples
- Initializing Casdoor SDK in Go:
package main
import (
"github.com/casdoor/casdoor-go-sdk/casdoorsdk"
)
func main() {
client := casdoorsdk.NewClient("http://localhost:8000", "YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET")
}
- Authenticating a user with username and password:
token, err := client.GetOAuthToken("password", "username", "password", "")
if err != nil {
// Handle error
}
// Use the token for authenticated requests
- Retrieving user information:
user, err := client.GetUser("username")
if err != nil {
// Handle error
}
// Access user properties
fmt.Printf("User: %s, Email: %s\n", user.Name, user.Email)
Getting Started
-
Install Casdoor:
git clone https://github.com/casdoor/casdoor.git cd casdoor go build
-
Configure the application:
- Copy
conf/app.conf.example
toconf/app.conf
- Modify the configuration file with your database settings and other preferences
- Copy
-
Run Casdoor:
./casdoor
-
Access the web interface at
http://localhost:8000
-
Create your first application and user through the web UI
-
Integrate Casdoor with your application using the appropriate SDK for your programming language
Competitor Comparisons
Open Source Identity and Access Management For Modern Applications and Services
Pros of Keycloak
- More mature and battle-tested, with a larger community and extensive documentation
- Offers advanced features like social login, user federation, and identity brokering
- Supports a wide range of protocols and standards (SAML, OpenID Connect, OAuth 2.0)
Cons of Keycloak
- Steeper learning curve and more complex setup compared to Casdoor
- Heavier resource consumption, which may impact performance on smaller systems
- Less flexibility in UI customization without extensive development effort
Code Comparison
Keycloak (Java):
public class KeycloakConfig {
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
auth.authenticationProvider(keycloakAuthenticationProvider());
}
}
Casdoor (Go):
func (c *Client) GetUser(name string) (*User, error) {
user := &User{}
err := c.doGetOrPost(http.MethodGet, "get-user", nil, user, name)
return user, err
}
The code snippets demonstrate the different languages and approaches used in each project. Keycloak uses Java and Spring Boot for configuration, while Casdoor employs Go for its API client implementation.
Headless cloud-native authentication and identity management written in Go. Scales to a billion+ users. Replace Homegrown, Auth0, Okta, Firebase with better UX and DX. Passkeys, Social Sign In, OIDC, Magic Link, Multi-Factor Auth, SMS, SAML, TOTP, and more. Runs everywhere, runs best on Ory Network.
Pros of Kratos
- More extensive documentation and guides
- Stronger focus on security and compliance (e.g., GDPR)
- Better integration with cloud-native environments
Cons of Kratos
- Steeper learning curve and more complex setup
- Less out-of-the-box UI components
- Requires additional services for complete functionality
Code Comparison
Kratos configuration (YAML):
selfservice:
strategies:
password:
enabled: true
oidc:
enabled: true
config:
providers:
- id: google
provider: google
client_id: ...
client_secret: ...
Casdoor configuration (JSON):
{
"name": "app-built-in",
"displayName": "Built-in App",
"logo": "https://cdn.casbin.org/img/casdoor-logo_1185x256.png",
"enablePassword": true,
"enableSignUp": true,
"providers": [
{
"name": "Google",
"clientId": "...",
"clientSecret": "..."
}
]
}
Both projects offer identity and access management solutions, but Kratos focuses more on API-first, cloud-native environments, while Casdoor provides a more user-friendly interface and easier setup for simpler use cases.
Open source alternative to Auth0 / Firebase Auth / AWS Cognito
Pros of SuperTokens
- More extensive documentation and guides for implementation
- Supports multiple programming languages and frameworks out-of-the-box
- Offers a managed cloud solution for easier deployment and maintenance
Cons of SuperTokens
- Less flexible in terms of customization compared to Casdoor
- Smaller community and fewer contributors
- Limited support for social login providers compared to Casdoor
Code Comparison
SuperTokens (Node.js):
import supertokens from "supertokens-node";
import Session from "supertokens-node/recipe/session";
supertokens.init({
appInfo: {
apiDomain: "https://api.example.com",
appName: "MyApp",
websiteDomain: "https://example.com"
},
recipeList: [Session.init()]
});
Casdoor (Go):
package main
import (
"github.com/casdoor/casdoor-go-sdk/casdoorsdk"
)
func main() {
casdoorsdk.InitConfig("http://localhost:8000", "app-built-in", "client-id", "client-secret")
}
Both repositories provide authentication and authorization solutions, but they differ in their approach and target audience. SuperTokens offers a more streamlined experience for developers with its extensive documentation and multi-language support, while Casdoor provides greater flexibility for customization and a wider range of social login options.
๐งโ๐ The better auth and identity infrastructure and the open-source alternative to Auth0. No framework restrictions.
Pros of Logto
- More modern and user-friendly UI design
- Better documentation and getting started guides
- Stronger focus on developer experience and ease of integration
Cons of Logto
- Fewer authentication protocols supported compared to Casdoor
- Less mature project with a smaller community
- Limited customization options for advanced use cases
Code Comparison
Logto (TypeScript):
import { LogtoClient } from '@logto/node';
const logto = new LogtoClient({
endpoint: 'https://your-logto-endpoint',
appId: 'your-application-id',
appSecret: 'your-application-secret',
});
Casdoor (Go):
import "github.com/casdoor/casdoor-go-sdk/casdoorsdk"
casdoorClient := &casdoorsdk.Client{
Endpoint: "https://your-casdoor-endpoint",
ClientId: "your-client-id",
ClientSecret: "your-client-secret",
}
Both projects provide SDKs for easy integration, but Logto's TypeScript implementation may be more appealing to modern web developers. Casdoor's Go implementation showcases its backend-focused approach and potential for high-performance applications.
ZITADEL - Identity infrastructure, simplified forย you.
Pros of Zitadel
- More comprehensive identity and access management (IAM) solution with advanced features like multi-factor authentication and passwordless login
- Built with Go, offering better performance and scalability
- Provides a GraphQL API in addition to REST, offering more flexibility for developers
Cons of Zitadel
- Steeper learning curve due to its more complex architecture and feature set
- Less extensive documentation compared to Casdoor
- Fewer integrations with third-party services out of the box
Code Comparison
Zitadel (Go):
func (h *Handler) Login(w http.ResponseWriter, r *http.Request) {
ctx, err := h.authz.CheckLoginRequest(r.Context(), r)
if err != nil {
h.renderError(w, r, err)
return
}
// ... (additional login logic)
}
Casdoor (Go):
func (c *ApiController) Login() {
var loginForm forms.AuthForm
err := json.Unmarshal(c.Ctx.Input.RequestBody, &loginForm)
if err != nil {
c.ResponseError(err.Error())
return
}
// ... (additional login logic)
}
Both projects use Go for their backend implementation, but Zitadel's code structure appears more modular and follows a more idiomatic Go style. Casdoor's code is simpler and may be easier for beginners to understand, but might be less scalable for larger projects.
The Single Sign-On Multi-Factor portal for web apps
Pros of Authelia
- More comprehensive authentication features, including 2FA and U2F support
- Better suited for self-hosted environments and home labs
- Stronger focus on security with features like brute-force protection
Cons of Authelia
- Steeper learning curve and more complex setup process
- Less extensive user management capabilities
- Limited built-in support for social login providers
Code Comparison
Authelia configuration (YAML):
authentication_backend:
file:
path: /config/users_database.yml
password:
algorithm: argon2id
iterations: 1
salt_length: 16
parallelism: 8
memory: 64
Casdoor configuration (JSON):
{
"name": "app-built-in",
"displayName": "Built-in App",
"logo": "https://cdn.casbin.org/img/casdoor-logo_1185x256.png",
"organization": "built-in",
"cert": "cert-built-in"
}
Both projects use configuration files, but Authelia relies more on YAML for its setup, while Casdoor uses JSON for many of its configurations. Authelia's configuration tends to be more detailed and security-focused, while Casdoor's is often simpler and more oriented towards application management.
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
รฐยยยฆรขยยกรฏยธย Casdoor
An open-source UI-first Identity and Access Management (IAM) / Single-Sign-On (SSO) platform with web UI supporting OAuth 2.0, OIDC, SAML, CAS, LDAP, SCIM, WebAuthn, TOTP, MFA and RADIUS
Sponsored by
Build auth with fraud prevention, faster.
Try Stytch for API-first authentication, user & org management, multi-tenant SSO, MFA, device fingerprinting, and more.
Online demo
- Read-only site: https://door.casdoor.com (any modification operation will fail)
- Writable site: https://demo.casdoor.com (original data will be restored for every 5 minutes)
Documentation
Install
- By source code: https://casdoor.org/docs/basic/server-installation
- By Docker: https://casdoor.org/docs/basic/try-with-docker
- By Kubernetes Helm: https://casdoor.org/docs/basic/try-with-helm
How to connect to Casdoor?
https://casdoor.org/docs/how-to-connect/overview
Casdoor Public API
Integrations
https://casdoor.org/docs/category/integrations
How to contact?
- Discord: https://discord.gg/5rPsrAzK7S
- Contact: https://casdoor.org/help
Contribute
For casdoor, if you have any questions, you can give Issues, or you can also directly start Pull Requests(but we recommend giving issues first to communicate with the community).
I18n translation
If you are contributing to casdoor, please note that we use Crowdin as translating platform and i18next as translating tool. When you add some words using i18next in the web/
directory, please remember to add what you have added to the web/src/locales/en/data.json
file.
License
Top Related Projects
Open Source Identity and Access Management For Modern Applications and Services
Headless cloud-native authentication and identity management written in Go. Scales to a billion+ users. Replace Homegrown, Auth0, Okta, Firebase with better UX and DX. Passkeys, Social Sign In, OIDC, Magic Link, Multi-Factor Auth, SMS, SAML, TOTP, and more. Runs everywhere, runs best on Ory Network.
Open source alternative to Auth0 / Firebase Auth / AWS Cognito
๐งโ๐ The better auth and identity infrastructure and the open-source alternative to Auth0. No framework restrictions.
ZITADEL - Identity infrastructure, simplified forย you.
The Single Sign-On Multi-Factor portal for web apps
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot