Zum Hauptinhalt springen

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

  1. 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.
  2. Optional Benutzerdefinierte Parameter, z. B. {"Quota": "10 GB"} für das Speicherkontingent.
  3. 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)

  1. Falls beim ersten Öffnen die Auswahl der Authentifizierungsart erscheint: Use built-in SAML authentication wählen.

  2. Unter Global settings (Globale Einstellungen) die Schalter setzen:

    EinstellungWert
    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 formAus
  3. 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:

AbschnittFeldWert
GeneralAttribute 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)
GeneralOptional display name of the identity provider (default: "SSO & SAML log in")Cofys
GeneralUse POST method for SAML request (default: GET)Aus
GeneralUse normal Nextcloud login formAus
Service Provider DataName ID formatEntity (oder Unspecified)
Service Provider DataX.509 certificate of the Service Provider, Private key of the Service Provider, Service Provider Entity ID (optional)leer lassen
Identity Provider DataIdentifier of the IdP entity (must be a URI)https://saml.cofys.de
Identity Provider DataURL Target of the IdP where the SP will send the Authentication Request Messagehttps://<Adresse der Instanz>/auth/saml/cloud/
Identity Provider DataURL Location of the IdP where the SP will send the SLO Request / SLO Responseleer lassen
Identity Provider DataPublic X.509 certificate of the IdPaus Panel → System → SSO-Anwendungen → Identitätsanbieter (IdP) Konfiguration kopieren
Identity Provider DataRequest parameters to pass-through to IdP (comma separated list)leer lassen
Attribute mappingAttribute to map the displayname to.http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name
Attribute mappingAttribute to map the email address to.http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress
Attribute mappingAttribute to map the quota to.Quota (nur wenn in Cofys als benutzerdefinierter Parameter gesetzt)
Attribute mappingAttribute to map the users home to.leer lassen
Attribute mappingAttribute to map the users groups to.http://schemas.xmlsoap.org/claims/Group
Attribute mappingAttribute 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 settingsSignatures and encryption offered / Signatures and encryption requiredalle Aus
Security settingsGeneral → Algorithm that the toolkit will use on signing process.http://www.w3.org/2001/04/xmldsig-more#rsa-sha256 (Standard)
User filteringReject 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.

Hängt zusammen mit​