Nextcloud per SAML anbinden
Bereich: Einrichtung externer Dienste · Status: aktiv (Systemapp cloud)
Verfügbar für: Betreiber / Nextcloud-Administrator
In einem Satz
Nextcloud nutzt Cofys als Anmeldedienst: Benutzer melden sich mit ihrem Cofys-Konto an, Cloud-Gruppen folgen den Cofys-Gruppen.
Wofür brauche ich das?
- Eine Vereins- oder Event-Cloud ohne eigene Passwörter.
- Ordner gezielt für Gruppen freigeben, die Cofys automatisch pflegt (z. B. „Teilnehmer Sommer-Event“).
Wo finde ich es?
In Nextcloud: App SSO & SAML authentication (user_saml). In Cofys: Panel → System → SSO-Anwendungen (Systemapp „Nextcloud“, Kennung cloud).
So funktioniert es
1. In Cofys
- Unter SSO-Anwendungen die Systemapp Nextcloud öffnen: ACS-URL der Nextcloud
(
https://<cloud>/apps/user_saml/saml/acs), Start-URL und Entity-ID (nextcloud) prüfen, Aktiv setzen. - Optional Benutzerdefinierte Parameter, z. B.
{"Quota": "10 GB"}für das Speicherkontingent. - Die Gruppen, die Zugang haben sollen, als App-Gruppe mit der App verknüpfen (siehe App-Anbindungen).
2. In Nextcloud – Hauptseite (Administration → SSO & SAML authentication)
-
Falls beim ersten Öffnen die Auswahl der Authentifizierungsart erscheint: Use built-in SAML authentication wählen.
-
Unter Global settings (Globale Einstellungen) die Schalter setzen:
Einstellung Wert Only allow authentication if an account exists on some other backend (e.g. LDAP). Aus Allow the use of multiple user back-ends (e.g. LDAP) Aus Use normal Nextcloud login form Aus -
Unter Registered Providers (Registrierte Anbieter) auf + klicken, um einen neuen Anbieter anzulegen (oder auf den bestehenden Eintrag Cofys klicken), damit sich das Konfigurationsfenster öffnet.
3. In Nextcloud – Anbieter-Dialog (Configure: Cofys) Im geöffneten Dialog die Abschnitte von oben nach unten ausfüllen:
| Abschnitt | Feld | Wert |
|---|---|---|
| General | Attribute to map the UID to. | http://schemas.xmlsoap.org/ws/2005/05/identity/claims/privatepersonalidentifier (unveränderliche Benutzer-ID; nach dem ersten Login zeigt Nextcloud darunter unter Attributes seen from this IdP die empfangenen Attribute an) |
| General | Optional display name of the identity provider (default: "SSO & SAML log in") | Cofys |
| General | Use POST method for SAML request (default: GET) | Aus |
| General | Use normal Nextcloud login form | Aus |
| Service Provider Data | Name ID format | Entity (oder Unspecified) |
| Service Provider Data | X.509 certificate of the Service Provider, Private key of the Service Provider, Service Provider Entity ID (optional) | leer lassen |
| Identity Provider Data | Identifier of the IdP entity (must be a URI) | https://saml.cofys.de |
| Identity Provider Data | URL Target of the IdP where the SP will send the Authentication Request Message | https://<Adresse der Instanz>/auth/saml/cloud/ |
| Identity Provider Data | URL Location of the IdP where the SP will send the SLO Request / SLO Response | leer lassen |
| Identity Provider Data | Public X.509 certificate of the IdP | aus Panel → System → SSO-Anwendungen → Identitätsanbieter (IdP) Konfiguration kopieren |
| Identity Provider Data | Request parameters to pass-through to IdP (comma separated list) | leer lassen |
| Attribute mapping | Attribute to map the displayname to. | http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name |
| Attribute mapping | Attribute to map the email address to. | http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress |
| Attribute mapping | Attribute to map the quota to. | Quota (nur wenn in Cofys als benutzerdefinierter Parameter gesetzt) |
| Attribute mapping | Attribute to map the users home to. | leer lassen |
| Attribute mapping | Attribute to map the users groups to. | http://schemas.xmlsoap.org/claims/Group |
| Attribute mapping | Attribute to map the users MFA login status, Attribute to map the users to an existing LDAP user, Group Mapping Prefix, default: SAML_ | leer lassen |
| Security settings | Signatures and encryption offered / Signatures and encryption required | alle Aus |
| Security settings | General → Algorithm that the toolkit will use on signing process. | http://www.w3.org/2001/04/xmldsig-more#rsa-sha256 (Standard) |
| User filtering | Reject members of these groups. / Require membership in these groups, if any. | leer lassen (Zugriffssteuerung läuft über die App-Gruppen in Cofys; optional kann hier zusätzlich nach Gruppen gefiltert werden) |
Am Ende des Dialogs zeigt Nextcloud Metadata valid an. Mit Save changes speichern.
UID-Zuordnung: Für neue Installationen die unveränderliche Benutzer-ID verwenden:
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/privatepersonalidentifier. Die alte Anleitung ordnete die UID dem
Anzeigenamen (…/claims/name) zu. Das funktioniert, bricht aber, sobald jemand seinen Benutzernamen ändert. Bestehende
Installationen nicht ohne Migration umstellen, sonst entstehen neue, leere Cloud-Konten.
Einstellungen und Optionen
Siehe oben.
Was passiert automatisch?
- Nextcloud legt beim ersten Login ein Konto an; Gruppen werden bei jedem Login aktualisiert.
- Beim ersten Login und bei neuen Scopes zeigt Cofys eine Zustimmungsseite.
Grenzen und Besonderheiten
- Notfallzugang, falls SAML nicht funktioniert:
https://<cloud>/login?direct=1. - Benutzer ohne verknüpfte App-Gruppe werden abgewiesen, wenn „App-Gruppe erforderlich“ aktiv ist.
- Wird das Signaturzertifikat von Cofys erneuert, muss es in Nextcloud nachgetragen werden.