> For the complete documentation index, see [llms.txt](https://docs.chamilo.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.chamilo.org/2.x-de/administrationshandbuch/admin-guide/authentication/ldap.md).

# LDAP

Chamilo kann Benutzer über einen LDAP-Server authentifizieren, einschließlich Microsoft Active Directory. LDAP wird in `config/authentication.yaml` konfiguriert.

## Konfiguration

```yaml
authentication:
  1:
    ldap:
      main:
        enabled: true
        title: "Mit LDAP anmelden"
        connection_string: "ldap://ldap.yourorg.com:389"
        protocol_version: 3
        referrals: false
        force_as_login_method: false
```

### Bind und Suche

Zwei Ansätze zur Lokalisierung des Benutzers im Verzeichnis:

**Direkter Bind** — erstellt den DN direkt aus dem Benutzernamen:

```yaml
        dn_string: "uid=%s,ou=people,dc=yourorg,dc=com"
```

**Such-Bind** — durchsucht das Verzeichnis zunächst mit einem Dienstkonto und bindet dann als gefundener Benutzer:

```yaml
        base_dn: "dc=yourorg,dc=com"
        search_dn: "cn=readonly,dc=yourorg,dc=com"
        search_password: "service-account-password"
        query_string: "(uid=%s)"
        uid_key: "uid"
```

Für Active Directory verwenden Sie `sAMAccountName` als `uid_key` und passen Sie `query_string` auf `(sAMAccountName=%s)` an.

### Attributzuordnung

Ordnen Sie LDAP-Attribute den Benutzerfeldern von Chamilo unter `data_correspondence` zu:

```yaml
        data_correspondence:
          firstname: givenName
          lastname: sn
          email: mail
          phone: telephoneNumber   # optional
          locale: preferredLanguage  # optional
```

`firstname`, `lastname` und `email` sind erforderlich. Der Benutzer wird mit einem bestehenden Chamilo-Konto anhand der E-Mail-Adresse oder des Benutzernamens abgeglichen; falls keine Übereinstimmung gefunden wird und `allow_create_new_users` auf true gesetzt ist, wird ein neues Konto erstellt.

## Tipps

* **Verwenden Sie LDAPS in der Produktion** — wechseln Sie von `ldap://` zu `ldaps://` (Port 636) für verschlüsselte Verbindungen.
* **Dienstkonto** — das Such-Bind-Konto benötigt nur Lesezugriff auf Benutzereinträge.
* **Zuerst testen** — überprüfen Sie Ihre Verbindungszeichenfolge und Abfrage mit `ldapsearch`, bevor Sie Chamilo konfigurieren.
* **`force_as_login_method: true`** — blendet andere Anmeldemethoden aus und zwingt alle Benutzer zur Nutzung von LDAP. Lassen Sie es während der Testphase auf `false`, damit Sie sich weiterhin als Administrator über das Standardformular anmelden können.

Für die vollständige Parameterreferenz siehe das [Wiki](https://github.com/chamilo/chamilo-lms/wiki/External-Authentication-configuration).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.chamilo.org/2.x-de/administrationshandbuch/admin-guide/authentication/ldap.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
