Was ist Authentik?
Authentik = Self-hosted Identity Provider (IdP)
Unterstützte Protokolle:
- SAML 2.0 (Enterprise-Standard)
- OAuth 2.0 / OpenID Connect (OIDC)
- LDAP (kompatibel mit AD-Abfragen)
- RADIUS (WLAN-Authentifizierung)
- Proxy-Authentifizierung (Forward Auth)
Vergleich:
Keycloak: Java, ressourcenintensiv, sehr mächtig
Authentik: Python+Go, schlanker, modernes UI
Zitadel: Sehr modernes UI, CIAM-Fokus
Authentik installieren
# docker-compose.yml
services:
postgresql:
image: postgres:16-alpine
environment:
POSTGRES_PASSWORD: sicherespasswort
POSTGRES_USER: authentik
POSTGRES_DB: authentik
volumes:
- postgres:/var/lib/postgresql/data
redis:
image: redis:alpine
command: --save 60 1 --loglevel warning
volumes:
- redis:/data
server:
image: ghcr.io/goauthentik/server:2024.10
command: server
environment:
AUTHENTIK_REDIS__HOST: redis
AUTHENTIK_POSTGRESQL__HOST: postgresql
AUTHENTIK_POSTGRESQL__USER: authentik
AUTHENTIK_POSTGRESQL__NAME: authentik
AUTHENTIK_POSTGRESQL__PASSWORD: sicherespasswort
AUTHENTIK_SECRET_KEY: superlangesgeheimnis50plus
AUTHENTIK_EMAIL__HOST: mail.firma.de
AUTHENTIK_EMAIL__FROM: [email protected]
ports:
- "9000:9000"
- "9443:9443"
volumes:
- ./media:/media
- ./custom-templates:/templates
worker:
image: ghcr.io/goauthentik/server:2024.10
command: worker
environment:
AUTHENTIK_REDIS__HOST: redis
AUTHENTIK_POSTGRESQL__HOST: postgresql
AUTHENTIK_POSTGRESQL__USER: authentik
AUTHENTIK_POSTGRESQL__NAME: authentik
AUTHENTIK_POSTGRESQL__PASSWORD: sicherespasswort
AUTHENTIK_SECRET_KEY: superlangesgeheimnis50plus
volumes:
- ./media:/media
volumes:
postgres:
redis:
docker compose up -d
# Admin-Setup
docker compose exec server ak create_admin_group
# Web-UI: https://server:9443/if/admin/
Nextcloud mit Authentik SSO (OAuth2)
Authentik → Providers → Create → OAuth2/OpenID Provider:
Name: Nextcloud
Client ID: nextcloud-client-id
Client Secret: [generieren]
Redirect URIs: https://cloud.firma.de/index.php/apps/oidc_login/oidc
Authentik → Applications → Create:
Name: Nextcloud
Provider: Nextcloud
Launch URL: https://cloud.firma.de
Nextcloud → Apps → Social Login → OIDC installieren
Admin → SSO & Social Login → Add Provider:
Identifier: authentik
Authorization endpoint: https://auth.firma.de/application/o/nextcloud/authorize/
Token endpoint: https://auth.firma.de/application/o/nextcloud/token/
Client ID: nextcloud-client-id
Client Secret: [secret]
Forward Auth (Proxy-Authentifizierung)
# Authentik schützt beliebige Web-Apps ohne Code-Änderung
# /etc/nginx/sites-available/geschuetzte-app
server {
location / {
auth_request /outpost.goauthentik.io/auth/nginx;
error_page 401 = @goauthentik_proxy_signin;
proxy_pass http://interne-app:8080;
}
location /outpost.goauthentik.io {
proxy_pass https://auth.firma.de;
}
location @goauthentik_proxy_signin {
internal;
return 302 /outpost.goauthentik.io/start?rd=$scheme://$host$request_uri;
}
}
FAQ
Was ist der Unterschied zwischen Authentik und Keycloak?
Keycloak: Java, sehr mächtig, komplexer, 512+ MB RAM. Authentik: Python/Go, modernes UI, einfacher einzurichten, 200 MB RAM.
Fazit
Authentik bietet vollständiges SSO für alle self-hosted Dienste: ein Login für Nextcloud, Gitea, Grafana und mehr – ohne proprietäre Lösungen.
SSO und Identity Management für KMU in Heidelberg, Mannheim und der Rhein-Neckar-Region. Anfragen.