# Autentikasi

## Pendaftaran pengguna

Pengaturan bawaan untuk Weblate adalah menggunakan python-social-auth, formulir di situs web untuk menangani pendaftaran pengguna baru. Setelah mengkonfirmasikan surel mereka, pengguna baru dapat berkontribusi atau mengautentikasikan dengan menggunakan salah satu layanan pihak ketiga.

Anda juga dapat mematikan pendaftaran pengguna baru menggunakan [`REGISTRATION_OPEN`](https://docs.weblate.org/id/latest/admin/config.md#std-setting-REGISTRATION_OPEN).

Percobaan autentikasi tunduk pada [Pembatasan akses](https://docs.weblate.org/id/latest/admin/optionals.md#rate-limit).

## Backend autentikasi

Weblate mengandalkan Django untuk autentikasi. Ini mencakup autentikasi berbasis kata sandi bawaan, autentikasi sosial, dan backend autentikasi pihak ketiga untuk Django.

Menggunakan autentikasi bawaan Django berarti Anda dapat mengimpor basis data pengguna proyek berbasis Django lainnya (lihat [Memigrasikan dari Pootle](https://docs.weblate.org/id/latest/admin/upgrade.md#pootle-migration)).

#### SEE ALSO
[Pengaturan autentikasi](https://docs.weblate.org/id/latest/admin/install/docker.md#docker-auth) menjelaskan cara mengkonfigurasikan autentikasi di gambar Docker resmi.

<a id="sso-team-sync"></a>

## Teams from identity providers

#### Versionadded
Added in version 2026.10.1.

Weblate can synchronize selected teams from external group memberships or
application roles during social authentication.
The default native and Docker pipelines include synchronization after
authentication checks and two-factor authentication. Extraction and assignment
are disabled until configured. If you use a custom authentication pipeline,
place `social_core.pipeline.user.sync_groups` after all authentication checks,
including `weblate.legal.pipeline.tos_confirm` when terms acceptance is enabled.

Map external identifiers to lists of existing Weblate team IDs. Find team IDs
in the administration interface URL or the teams REST API. Names can repeat
across project and workspace scopes, so they are not used as mapping targets.

For Microsoft Entra ID, prefer application roles:

```default
SOCIAL_AUTH_AZUREAD_TENANT_OAUTH2_GROUPS_KEY = "roles"
SOCIAL_AUTH_AZUREAD_TENANT_OAUTH2_GROUPS_MAP = {
    "Weblate.Translator": [42],
    "Weblate.Reviewer": [43],
}
```

Configure the provider to issue these roles. Group identifiers can instead be
selected with `GROUPS_KEY = "groups"`. Group overage causes authentication
to fail; Weblate does not retrieve memberships from Microsoft Graph. Restrict
the trusted tenant and issuer before granting permissions, especially when
using a common Azure endpoint.

For generic OpenID Connect or Keycloak, configure a literal claim name:

```default
SOCIAL_AUTH_OIDC_GROUPS_KEY = "groups"
SOCIAL_AUTH_OIDC_GROUPS_MAP = {"translators": [42]}

SOCIAL_AUTH_KEYCLOAK_GROUPS_KEY = "groups"
SOCIAL_AUTH_KEYCLOAK_GROUPS_MAP = {"/organization/reviewers": [43]}
```

For GitLab, explicitly enable membership retrieval:

```default
SOCIAL_AUTH_GITLAB_GROUPS_ENABLED = True
SOCIAL_AUTH_GITLAB_GROUPS_MAP = {"organization/translators": [42]}
```

Enabling retrieval automatically requests `read_api` unless `read_api` or
`api` is already requested. Enable the corresponding permission in the GitLab
OAuth application settings alongside `read_user`.

GitLab uses full group paths by default. Use stable numeric group IDs instead
when paths might change or be reused:

```default
SOCIAL_AUTH_GITLAB_GROUPS_IDENTIFIER = "id"
SOCIAL_AUTH_GITLAB_GROUPS_MAP = {"12345": [42]}
```

For SAML, add the group attribute and mapping to each existing entry in
`SOCIAL_AUTH_SAML_ENABLED_IDPS`:

```default
SOCIAL_AUTH_SAML_ENABLED_IDPS["company"].update(
    {
        "attr_groups": "https://example.com/claims/groups",
        "groups_map": {"translators": [42]},
        "allow_groups": ["translators", "reviewers"],
    }
)
```

All targets in a mapping become provider-managed teams. Authentication adds
desired memberships and removes obsolete managed memberships. Unrelated
teams and existing membership language restrictions are preserved. Changes
are recorded in the audit log. Manual membership in a managed team is subject
to replacement at the next authentication. A team may be managed by only one
configured provider or SAML IdP; conflicting mappings and nonexistent teams
cause errors before memberships change. No teams are created automatically.

A missing configured claim fails authentication. When a provider omits claims
for users without assignments, explicitly enable its
`SOCIAL_AUTH_<BACKEND>_GROUPS_MISSING_AS_EMPTY` setting. SAML uses
`groups_missing_as_empty` in the IdP entry. An empty membership list removes
all provider-managed memberships. An empty `GROUPS_MAP` disables assignment.

Login restrictions are independent of assignment. Configure
`SOCIAL_AUTH_<BACKEND>_ALLOW_GROUPS` to require membership in any listed
external group or role. Unknown identifiers grant nothing, but do not reject
login unless an allow list is configured. Existing CAS allow lists require no
new settings or pipeline entries.

Synchronization applies to login, registration, and authentication-method
linking. Password reset and account removal do not synchronize teams. Updates
occur only during authentication; this does not deactivate accounts or revoke
access in the background. Synchronization does not store external membership
snapshots.

In Docker installations, use [Konfigurasi di luar variabel lingkungan](https://docs.weblate.org/id/latest/admin/install/docker.md#docker-custom-config) to supply these Python
settings; there are no dedicated environment variables for team mappings.

#### SEE ALSO
[External groups](https://python-social-auth.readthedocs.io/en/latest/groups.html)

## Autentikasi sosial

Berkat [Welcome to Python Social Auth’s documentation!](https://python-social-auth.readthedocs.io/en/latest/index.html), Weblate mendukung autentikasi menggunakan banyak layanan pihak ketiga seperti GitLab, Ubuntu, Fedora, dll.

Silakan periksa dokumentasi mereka untuk melihat petunjuk konfigurasi umum di [Django Framework](https://python-social-auth.readthedocs.io/en/latest/configuration/django.html).

#### NOTE
Secara bawaan, Weblate mengandalkan layanan autentikasi pihak ketiga untuk memberikan alamat surel yang divalidasi. Jika beberapa layanan yang ingin Anda gunakan tidak mendukung ini, harap terapkan validasi surel di sisi Weblate dengan mengkonfigurasikan FORCE_EMAIL_VALIDATION untuk layanan tersebut. Sebagai contoh:

```python
SOCIAL_AUTH_OPENSUSE_FORCE_EMAIL_VALIDATION = True
```

#### SEE ALSO
[Pipeline](https://python-social-auth.readthedocs.io/en/latest/pipeline.html)

Provider names are normalized by Python Social Auth's `social_names` pipeline
step before Weblate initializes an empty full name. Existing full names are
preserved. Weblate cleans and limits the resulting name and falls back to the
username when the provider name is missing or invalid.

`SOCIAL_AUTH_FIRSTLAST_FROM_FULL` and `SOCIAL_AUTH_FULL_FROM_FIRSTLAST`
control name conversion and both default to `True`. Backend-specific settings
are supported, for example `SOCIAL_AUTH_SAML_FULL_FROM_FIRSTLAST = False`.
See [Name normalization](https://python-social-auth.readthedocs.io/en/latest/pipeline.html#name-normalization) for the conversion rules. Custom
`SOCIAL_AUTH_PIPELINE` configurations should include
`social_core.pipeline.social_auth.social_names` after `social_details`.

Mengaktifkan backend individual cukup mudah, hanya masalah penambahan entri ke pengaturan [`AUTHENTICATION_BACKENDS`](https://docs.djangoproject.com/id/stable/ref/settings/#std-setting-AUTHENTICATION_BACKENDS) dan mungkin menambahkan kunci yang diperlukan untuk metode autentikasi yang diberikan. Harap dicatat bahwa beberapa backend tidak menyediakan surel pengguna secara bawaan, Anda harus memintanya secara eksplisit, jika tidak, Weblate tidak akan dapat mengkredit kontribusi yang dibuat pengguna dengan benar.

#### HINT
Sebagian besar backend autentikasi memerlukan HTTPS. Setelah HTTPS diaktifkan di server web Anda, silakan konfigurasikan Weblate untuk melaporkannya dengan benar menggunakan [`ENABLE_HTTPS`](https://docs.weblate.org/id/latest/admin/config.md#std-setting-ENABLE_HTTPS), atau dengan [`WEBLATE_ENABLE_HTTPS`](https://docs.weblate.org/id/latest/admin/install/docker.md#envvar-WEBLATE_ENABLE_HTTPS) di kontainer Docker.

#### SEE ALSO
[Backend Auth Sosial Python](https://python-social-auth.readthedocs.io/en/latest/backends/index.html)

### Authentication storage cleanup

Weblate removes expired OpenID protocol associations and OpenID Connect login
nonces in its hourly authentication cleanup task. OIDC login attempts have a
30-minute nonce lifetime by default; expiry is enforced during login even before
the next cleanup runs. Linked accounts are preserved. Verification codes and
partial pipelines retain their existing [`AUTH_TOKEN_VALID`](https://docs.weblate.org/id/latest/admin/config.md#std-setting-AUTH_TOKEN_VALID) policy.

The social-auth database migration gives existing undated OIDC nonces a
30-minute grace period from upgrade. Follow the usual upgrade procedure with
old login-serving processes stopped while applying migrations. For backend
configuration, see [OIDC (OpenID Connect)](https://python-social-auth.readthedocs.io/en/latest/backends/oidc.html).

### Autentikasi OpenID

Untuk layanan berbasis OpenID biasanya hanya masalah pengaktifannya. Bagian berikut mengaktifkan autentikasi OpenID untuk OpenSUSE, Fedora, dan Ubuntu:

```python
# Authentication configuration
AUTHENTICATION_BACKENDS = (
    "social_core.backends.email.EmailAuth",
    "social_core.backends.suse.OpenSUSEOpenId",
    "social_core.backends.ubuntu.UbuntuOpenId",
    "social_core.backends.fedora.FedoraOpenId",
    "weblate.accounts.auth.WeblateUserBackend",
)
```

#### SEE ALSO
[OpenID](https://python-social-auth.readthedocs.io/en/latest/backends/openid.html)

<a id="keycloak-auth"></a>

### Keycloak authentication

Register a client in Keycloak with the callback URL
`https://WEBLATE SERVER/accounts/complete/keycloak/`. Follow
[Keycloak - Open Source Red Hat SSO](https://python-social-auth.readthedocs.io/en/latest/backends/keycloak.html) for the client credentials, signing key, audience,
and endpoint configuration. Add
`social_core.backends.keycloak.KeycloakOAuth2` to
[`AUTHENTICATION_BACKENDS`](https://docs.djangoproject.com/id/stable/ref/settings/#std-setting-AUTHENTICATION_BACKENDS) alongside the Weblate backends.

Use the stable subject claim to identify accounts:

```default
SOCIAL_AUTH_KEYCLOAK_ID_KEY = "sub"
SOCIAL_AUTH_KEYCLOAK_LEGACY_ID_KEYS = ["email"]
SOCIAL_AUTH_KEYCLOAK_ALLOW_UNVERIFIED_LEGACY_UID_MIGRATION = False
```

Docker also uses `sub` with historical e-mail lookup, but enables compatibility
migration when no identifier is explicitly configured, as described below. See the
[`WEBLATE_SOCIAL_AUTH_KEYCLOAK_KEY`](https://docs.weblate.org/id/latest/admin/install/docker.md#envvar-WEBLATE_SOCIAL_AUTH_KEYCLOAK_KEY) configuration variables.

#### WARNING
E-mail addresses and usernames can change or be reassigned to another
Keycloak account. Using either as `ID_KEY` can let the new owner access
an existing Weblate account. E-mail verification does not prevent this
reassignment risk.

Weblate relies on the provider to validate e-mail addresses, as described in
[Social authentication](). If the realm does not enforce validation, configure
`SOCIAL_AUTH_KEYCLOAK_FORCE_EMAIL_VALIDATION = True`. This controls e-mail
validation and does not replace the stable account identifier.

#### Upgrading existing Keycloak associations

Earlier Docker configurations defaulted to `email`. Python Social Auth
migrates existing associations to `sub` on the next successful login.
When [`WEBLATE_SOCIAL_AUTH_KEYCLOAK_ID_KEY`](https://docs.weblate.org/id/latest/admin/install/docker.md#envvar-WEBLATE_SOCIAL_AUTH_KEYCLOAK_ID_KEY) is unset, Docker enables
`SOCIAL_AUTH_KEYCLOAK_ALLOW_UNVERIFIED_LEGACY_UID_MIGRATION` so that
associations without a saved subject can migrate using their historical e-mail
address or username. An explicit identifier disables this compatibility default,
including an explicit `sub`. You can override the policy using
[`WEBLATE_SOCIAL_AUTH_KEYCLOAK_ALLOW_UNVERIFIED_LEGACY_UID_MIGRATION`](https://docs.weblate.org/id/latest/admin/install/docker.md#envvar-WEBLATE_SOCIAL_AUTH_KEYCLOAK_ALLOW_UNVERIFIED_LEGACY_UID_MIGRATION).
After migration, authentication matches the subject instead of the historical
identifier. Conflicting saved subject evidence still stops authentication.

#### WARNING
Until an association migrates, its historical e-mail address or username
remains sufficient to claim it. A different Keycloak account assigned that
identifier could take over the association during migration. Once migrated,
the association is bound to the subject and this fallback no longer applies.

To require saved subject evidence instead, set
`SOCIAL_AUTH_KEYCLOAK_ALLOW_UNVERIFIED_LEGACY_UID_MIGRATION = False` in your
Django settings, or set
[`WEBLATE_SOCIAL_AUTH_KEYCLOAK_ALLOW_UNVERIFIED_LEGACY_UID_MIGRATION`](https://docs.weblate.org/id/latest/admin/install/docker.md#envvar-WEBLATE_SOCIAL_AUTH_KEYCLOAK_ALLOW_UNVERIFIED_LEGACY_UID_MIGRATION)
to `0` in Docker. Associations without this evidence then require recovery
through another login method, removal of the stale association, and linking the
identity again, or administrative repair using independently verified Keycloak
records.

Before applying the Python Social Auth historical-key backfill migration,
configure `SOCIAL_AUTH_OLD_ID_KEYS` with the identifier that actually created
the associations. For example, for the historical Docker default:

```default
SOCIAL_AUTH_OLD_ID_KEYS = {"keycloak": "email"}
```

Docker sets this mapping to `email` unless
[`WEBLATE_SOCIAL_AUTH_KEYCLOAK_ID_KEY`](https://docs.weblate.org/id/latest/admin/install/docker.md#envvar-WEBLATE_SOCIAL_AUTH_KEYCLOAK_ID_KEY) is explicitly configured, in which
case it assumes that value also created the historical associations. This
historical default is `email` even though the new active default is `sub`.
If you change this variable during the upgrade,
override the historical mapping separately using
[Menimpa pengaturan dari volume data](https://docs.weblate.org/id/latest/admin/install/docker.md#docker-settings-override). In particular, retain the historical `sub`
mapping for deployments that already used subjects. Never infer the historical
key from the identifier value alone.

If the migration has already assigned incorrect keys, changing
`SOCIAL_AUTH_OLD_ID_KEYS` does not repair them. Audit and correct affected
associations against trusted provider records. See
[Identifier migration](https://python-social-auth.readthedocs.io/en/latest/configuration/identifier-migration.html) for evidence requirements and
backfill details. Explicit mutable identifier overrides remain supported, but
must be changed to `sub` to obtain the protection described here.

<a id="github-auth"></a>

### Autentikasi GitHub

Anda perlu mendaftarkan aplikasi OAuth di GitHub kemudian memberi tahu Weblate semua rahasianya:

```python
# Authentication configuration
AUTHENTICATION_BACKENDS = (
    "social_core.backends.github.GithubOAuth2",
    "social_core.backends.email.EmailAuth",
    "weblate.accounts.auth.WeblateUserBackend",
)

# Social auth backends setup
SOCIAL_AUTH_GITHUB_KEY = "GitHub Client ID"
SOCIAL_AUTH_GITHUB_SECRET = "GitHub Client Secret"
SOCIAL_AUTH_GITHUB_SCOPE = ["user:email"]
```

GitHub harus dikonfigurasikan untuk memiliki URL panggilan balik sebagai `https://WEBLATE SERVER/accounts/complete/github/`.

Terdapat backend autentikasi serupa untuk GitHub for Organizations dan GitHub for Teams. Pengaturannya bernama `SOCIAL_AUTH_GITHUB_ORG_*` dan `SOCIAL_AUTH_GITHUB_TEAM_*`, dan keduanya memerlukan pengaturan tambahan untuk cakupannya - `SOCIAL_AUTH_GITHUB_ORG_NAME` atau `SOCIAL_AUTH_GITHUB_TEAM_ID`. URL panggilan baliknya adalah `https://WEBLATE SERVER/accounts/complete/github-org/` dan `https://WEBLATE SERVER/accounts/complete/github-teams/`.

#### NOTE
URL panggilan balik yang disediakan oleh Weblate selama autentikasi mencakup domain yang dikonfigurasi. Jika Anda mendapatkan galat tentang ketidakcocokan URL, Anda mungkin ingin memperbaikinya, lihat [Atur domain situs yang benar](https://docs.weblate.org/id/latest/admin/install.md#production-site).

#### SEE ALSO
[GitHub](https://python-social-auth.readthedocs.io/en/latest/backends/github.html)

<a id="github-ee-auth"></a>

### Autentikasi GitHub EE

Anda perlu mendaftarkan Aplikasi OAuth di GitHub EE dan kemudian memberi tahu Weblate semua rahasianya:

```python
# Authentication configuration
AUTHENTICATION_BACKENDS = (
    "social_core.backends.github_enterprise.GithubEnterpriseOAuth2",
    "social_core.backends.email.EmailAuth",
    "weblate.accounts.auth.WeblateUserBackend",
)

# Social auth backends setup
SOCIAL_AUTH_GITHUB_ENTERPRISE_KEY = "GitHub OAuth App Client ID"
SOCIAL_AUTH_GITHUB_ENTERPRISE_SECRET = "GitHub OAuth App Client Secret"
SOCIAL_AUTH_GITHUB_ENTERPRISE_URL = "https://git.example.com/"
SOCIAL_AUTH_GITHUB_ENTERPRISE_API_URL = "https://git.example.com/api/v3/"
SOCIAL_AUTH_GITHUB_ENTERPRISE_SCOPE = ["user:email"]
```

Aplikasi GitHub OAuth harus dikonfigurasikan untuk memiliki URL panggilan balik sebagai `https://WEBLATE SERVER/accounts/complete/github-enterprise/`.

Selain Aplikasi OAuth GitHub, Aplikasi GitHub juga dapat digunakan. Dengan Aplikasi GitHub, izin dapat diberikan pada repositori, organisasi, dan/atau tingkat pengguna. Jika Anda memutuskan untuk menggunakan Aplikasi GitHub, Anda perlu mengaktifkan izin Akses: Hanya baca untuk Pengguna - <Alamat surel> dan Organisasi - <Anggota>.

#### NOTE
URL panggilan balik yang disediakan oleh Weblate selama autentikasi mencakup domain yang dikonfigurasi. Jika Anda mendapatkan galat tentang ketidakcocokan URL, Anda mungkin ingin memperbaikinya, lihat [Atur domain situs yang benar](https://docs.weblate.org/id/latest/admin/install.md#production-site).

#### SEE ALSO
[Backend classes](https://python-social-auth.readthedocs.io/en/latest/backends/github_enterprise.html)

<a id="bitbucket-auth"></a>

### Autentikasi Bitbucket

Anda perlu mendaftarkan aplikasi di Bitbucket kemudian memberi tahu Weblate semua rahasianya:

```python
# Authentication configuration
AUTHENTICATION_BACKENDS = (
    "social_core.backends.bitbucket.BitbucketOAuth2",
    "social_core.backends.email.EmailAuth",
    "weblate.accounts.auth.WeblateUserBackend",
)

# Social auth backends setup
SOCIAL_AUTH_BITBUCKET_OAUTH2_KEY = "Bitbucket Client ID"
SOCIAL_AUTH_BITBUCKET_OAUTH2_SECRET = "Bitbucket Client Secret"
SOCIAL_AUTH_BITBUCKET_OAUTH2_VERIFIED_EMAILS_ONLY = True
```

#### NOTE
URL panggilan balik yang disediakan oleh Weblate selama autentikasi mencakup domain yang dikonfigurasi. Jika Anda mendapatkan galat tentang ketidakcocokan URL, Anda mungkin ingin memperbaikinya, lihat [Atur domain situs yang benar](https://docs.weblate.org/id/latest/admin/install.md#production-site).

#### SEE ALSO
[Bitbucket](https://python-social-auth.readthedocs.io/en/latest/backends/bitbucket.html)

<a id="google-auth"></a>

### Google OAuth 2

Untuk menggunakan Google OAuth 2, Anda perlu mendaftarkan aplikasi OAuth di <[https://console.developers.google.com/](https://console.developers.google.com/)>.

URL pengalihannya adalah `https://WEBLATE SERVER/accounts/complete/google-oauth2/`.

```python
# Authentication configuration
AUTHENTICATION_BACKENDS = (
    "social_core.backends.google.GoogleOAuth2",
    "social_core.backends.email.EmailAuth",
    "weblate.accounts.auth.WeblateUserBackend",
)

# Social auth backends setup
SOCIAL_AUTH_GOOGLE_OAUTH2_KEY = "Client ID"
SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET = "Client secret"
```

#### NOTE
URL panggilan balik yang disediakan oleh Weblate selama autentikasi mencakup domain yang dikonfigurasi. Jika Anda mendapatkan galat tentang ketidakcocokan URL, Anda mungkin ingin memperbaikinya, lihat [Atur domain situs yang benar](https://docs.weblate.org/id/latest/admin/install.md#production-site).

#### SEE ALSO
[Google](https://python-social-auth.readthedocs.io/en/latest/backends/google.html)

<a id="facebook-auth"></a>

### Facebook OAuth 2

Seperti biasa dengan layanan OAuth 2, Anda harus mendaftarkan aplikasi Anda ke Facebook. Setelah ini selesai, Anda dapat menyiapkan Weblate untuk menggunakannya:

URL pengalihannya adalah `https://WEBLATE SERVER/accounts/complete/facebook/`.

```python
# Authentication configuration
AUTHENTICATION_BACKENDS = (
    "social_core.backends.facebook.FacebookOAuth2",
    "social_core.backends.email.EmailAuth",
    "weblate.accounts.auth.WeblateUserBackend",
)

# Social auth backends setup
SOCIAL_AUTH_FACEBOOK_KEY = "key"
SOCIAL_AUTH_FACEBOOK_SECRET = "secret"
SOCIAL_AUTH_FACEBOOK_SCOPE = ["email", "public_profile"]
```

#### NOTE
URL panggilan balik yang disediakan oleh Weblate selama autentikasi mencakup domain yang dikonfigurasi. Jika Anda mendapatkan galat tentang ketidakcocokan URL, Anda mungkin ingin memperbaikinya, lihat [Atur domain situs yang benar](https://docs.weblate.org/id/latest/admin/install.md#production-site).

#### SEE ALSO
[Facebook](https://python-social-auth.readthedocs.io/en/latest/backends/facebook.html)

<a id="gitlab-auth"></a>

### GitLab OAuth 2

Untuk menggunakan GitLab OAuth 2, Anda perlu mendaftarkan aplikasi di <[https://gitlab.com/profile/applications](https://gitlab.com/profile/applications)>.

URL pengalihannya adalah `https://WEBLATE SERVER/accounts/complete/gitlab/` dan pastikan Anda menandai cakupan read_user.

```python
# Authentication configuration
AUTHENTICATION_BACKENDS = (
    "social_core.backends.gitlab.GitLabOAuth2",
    "social_core.backends.email.EmailAuth",
    "weblate.accounts.auth.WeblateUserBackend",
)

# Social auth backends setup
SOCIAL_AUTH_GITLAB_KEY = "Application ID"
SOCIAL_AUTH_GITLAB_SECRET = "Secret"
SOCIAL_AUTH_GITLAB_SCOPE = ["read_user"]

# If you are using your own GitLab
# SOCIAL_AUTH_GITLAB_API_URL = 'https://gitlab.example.com/'
```

#### NOTE
URL panggilan balik yang disediakan oleh Weblate selama autentikasi mencakup domain yang dikonfigurasi. Jika Anda mendapatkan galat tentang ketidakcocokan URL, Anda mungkin ingin memperbaikinya, lihat [Atur domain situs yang benar](https://docs.weblate.org/id/latest/admin/install.md#production-site).

#### SEE ALSO
[GitLab](https://python-social-auth.readthedocs.io/en/latest/backends/gitlab.html)

<a id="gitea-auth"></a>

### Gitea OAuth 2

Untuk menggunakan Gitea OAuth 2, Anda perlu mendaftarkan aplikasi di `https://GITEA SERVER/user/settings/applications`.

URL pengalihannya adalah `https://WEBLATE SERVER/accounts/complete/gitea/`.

```python
# Authentication configuration
AUTHENTICATION_BACKENDS = (
    "social_core.backends.gitea.GiteaOAuth2",
    "social_core.backends.email.EmailAuth",
    "weblate.accounts.auth.WeblateUserBackend",
)

# Social auth backends setup
SOCIAL_AUTH_GITEA_KEY = ""
SOCIAL_AUTH_GITEA_SECRET = ""

# If you are using your own Gitea
SOCIAL_AUTH_GITEA_API_URL = "https://gitea.example.com/"
```

#### NOTE
URL panggilan balik yang disediakan oleh Weblate selama autentikasi mencakup domain yang dikonfigurasi. Jika Anda mendapatkan galat tentang ketidakcocokan URL, Anda mungkin ingin memperbaikinya, lihat [Atur domain situs yang benar](https://docs.weblate.org/id/latest/admin/install.md#production-site).

#### NOTE
Konfigurasi di atas juga berfungsi dengan Forgejo; untuk contoh penyebaran produksi dengan Forgejo, lihat [Codeberg Translate](https://translate.codeberg.org).

#### SEE ALSO
[Gitea](https://python-social-auth.readthedocs.io/en/latest/backends/gitea.html)

<a id="azure-auth"></a>

<a id="entra-auth"></a>

### Microsoft Entra ID

Azure Active Directory (Azure AD) is now Microsoft Entra ID. Weblate keeps the
`azuread-oauth2` and `azuread-tenant-oauth2` backend names for
compatibility with the underlying Python Social Auth backends and existing
deployments.

Weblate dapat dikonfigurasikan untuk menggunakan penyewa autentikasi umum atau spesifik.

URL pengalihannya adalah `https://WEBLATE SERVER/accounts/complete/azuread-oauth2/` untuk umum dan `https://WEBLATE SERVER/accounts/complete/azuread-tenant-oauth2/` untuk penyewa autentikasi khusus.

Anda akan memerlukan hal berikut:

* *Application (client) ID* is available on the app registration overview in the
  Microsoft Entra admin center. *Object ID* is not used in Weblate.
* *ID Direktori (penyewa)* diperlukan untuk autentikasi cakupan penyewa, yang biasanya diinginkan.
* *Secret value* is displayed once you create a client secret for the app
  registration. *Secret ID* is not used in Weblate.

```python
# Microsoft Entra ID common

# Authentication configuration
AUTHENTICATION_BACKENDS = (
    "social_core.backends.azuread.AzureADOAuth2",
    "social_core.backends.email.EmailAuth",
    "weblate.accounts.auth.WeblateUserBackend",
)

# OAuth2 keys
SOCIAL_AUTH_AZUREAD_OAUTH2_KEY = ""
SOCIAL_AUTH_AZUREAD_OAUTH2_SECRET = ""
```

```python
# Microsoft Entra ID with Tenant

# Authentication configuration
AUTHENTICATION_BACKENDS = (
    "social_core.backends.azuread_tenant.AzureADTenantOAuth2",
    "social_core.backends.email.EmailAuth",
    "weblate.accounts.auth.WeblateUserBackend",
)

# Application (client) ID
SOCIAL_AUTH_AZUREAD_TENANT_OAUTH2_KEY = ""
# Secret value
SOCIAL_AUTH_AZUREAD_TENANT_OAUTH2_SECRET = ""
# Directory (tenant) ID
SOCIAL_AUTH_AZUREAD_TENANT_OAUTH2_TENANT_ID = ""
```

#### NOTE
URL panggilan balik yang disediakan oleh Weblate selama autentikasi mencakup domain yang dikonfigurasi. Jika Anda mendapatkan galat tentang ketidakcocokan URL, Anda mungkin ingin memperbaikinya, lihat [Atur domain situs yang benar](https://docs.weblate.org/id/latest/admin/install.md#production-site).

#### SEE ALSO
[Microsoft Entra ID and Azure AD B2C](https://python-social-auth.readthedocs.io/en/latest/backends/azuread.html)

<a id="slack-auth"></a>

### Slack

Untuk menggunakan Slack OAuth 2, Anda perlu mendaftarkan aplikasi di <[https://api.slack.com/apps](https://api.slack.com/apps)>.

URL pengalihannya adalah `https://WEBLATE SERVER/accounts/complete/slack/`.

```python
# Authentication configuration
AUTHENTICATION_BACKENDS = (
    "social_core.backends.slack.SlackOAuth2",
    "social_core.backends.email.EmailAuth",
    "weblate.accounts.auth.WeblateUserBackend",
)

# Social auth backends setup
SOCIAL_AUTH_SLACK_KEY = ""
SOCIAL_AUTH_SLACK_SECRET = ""
```

#### NOTE
URL panggilan balik yang disediakan oleh Weblate selama autentikasi mencakup domain yang dikonfigurasi. Jika Anda mendapatkan galat tentang ketidakcocokan URL, Anda mungkin ingin memperbaikinya, lihat [Atur domain situs yang benar](https://docs.weblate.org/id/latest/admin/install.md#production-site).

#### SEE ALSO
[Slack](https://python-social-auth.readthedocs.io/en/latest/backends/slack.html)

<a id="weblate-auth"></a>

### Weblate OpenID Connect

#### Versionadded
Added in version 2026.11.

To sign in through Hosted Weblate or another Weblate installation, register a
confidential authorization-code client with RSA SHA-256 signing on its
[OpenID Connect identity provider](#oidc-provider). Register this installation's exact HTTPS callback URL,
for example `https://weblate.example.com/accounts/complete/weblate/`.

Add the backend and client credentials to your settings:

```python
# Authentication configuration
AUTHENTICATION_BACKENDS = (
    "social_core.backends.weblate.WeblateOpenIdConnect",
    "social_core.backends.email.EmailAuth",
    "weblate.accounts.auth.WeblateUserBackend",
)

# Social auth backends setup
SOCIAL_AUTH_WEBLATE_KEY = "Client ID"
SOCIAL_AUTH_WEBLATE_SECRET = "Client secret"
```

The default issuer is `https://hosted.weblate.org/oidc`. To authenticate
against another installation, configure its issuer URL, including any
deployment prefix:

```python
SOCIAL_AUTH_WEBLATE_OIDC_ENDPOINT = "https://example.com/translations/oidc"
```

Do not append `/.well-known/openid-configuration`. The backend discovers the
provider endpoints and requests the `openid profile email` scopes. Keep
PKCE enabled; Weblate requires it.

The sign-in label is Hosted Weblate for Hosted Weblate and
Weblate for other installations. Override the label or icon with
`SOCIAL_AUTH_WEBLATE_TITLE` or `SOCIAL_AUTH_WEBLATE_IMAGE`.

Changing the issuer requires an explicit migration of existing account
associations: the same subject identifier on different servers can refer to
different people.

#### NOTE
URL panggilan balik yang disediakan oleh Weblate selama autentikasi mencakup domain yang dikonfigurasi. Jika Anda mendapatkan galat tentang ketidakcocokan URL, Anda mungkin ingin memperbaikinya, lihat [Atur domain situs yang benar](https://docs.weblate.org/id/latest/admin/install.md#production-site).

#### SEE ALSO
* [Weblate OpenID Connect](https://docs.weblate.org/id/latest/admin/install/docker.md#docker-weblate-auth)
* [Weblate](https://python-social-auth.readthedocs.io/en/latest/backends/weblate.html)

### Menimpa nama dan ikon dari metode autentikasi

Display names and bundled icons come from python-social-auth backend metadata.
Weblate retains translated labels and local icons for its password and e-mail
methods, and supplies its own fallback icon for providers without a logo.
Add `social_django.finders.SocialAuthIconFinder` after the standard finders in
`STATICFILES_FINDERS` to collect the provider icons from social-auth-core.
The example and Docker settings include this finder. Run
`weblate collectstatic --noinput` after upgrading.

You can override the authentication method display name and icon using settings as
`SOCIAL_AUTH_<NAME>_IMAGE` and `SOCIAL_AUTH_<NAME>_TITLE`. For example
overriding naming for Auth0 would look like:

```python
SOCIAL_AUTH_AUTH0_IMAGE = "custom.svg"
SOCIAL_AUTH_AUTH0_TITLE = "Custom auth"
```

Relative image names retain the `auth/` static directory convention. Existing
bundled filenames, such as `auth0.svg`, also resolve to the shared
`social_auth/icons/` directory when no local override exists. Full HTTP URLs
and data URLs continue to work.

<a id="disable-email-auth"></a>

### Mematikan autentikasi kata sandi

Autentikasi surel dan kata sandi dapat dimatikan dengan menghapus `social_core.backends.email.EmailAuth` dari [`AUTHENTICATION_BACKENDS`](https://docs.djangoproject.com/id/stable/ref/settings/#std-setting-AUTHENTICATION_BACKENDS). Selalu simpan `weblate.accounts.auth.WeblateUserBackend` di sana, ini diperlukan untuk fungsionalitas inti Weblate.

Menonaktifkan autentikasi surel akan menonaktifkan semua fungsi yang terkait dengan surel dan undangan pengguna atau fitur pengaturan ulang kata sandi.

#### TIP
Anda masih dapat menggunakan autentikasi kata sandi untuk antarmuka admin, untuk pengguna yang Anda buat secara manual di sana. Cukup arahkan ke `/admin/login/`.

Misalnya, autentikasi hanya menggunakan penyedia Open ID openSUSE dapat dicapai dengan menggunakan yang berikut:

```python
# Authentication configuration
AUTHENTICATION_BACKENDS = (
    "social_core.backends.suse.OpenSUSEOpenId",
    "weblate.accounts.auth.WeblateUserBackend",
)
```

<a id="password-authentication"></a>

## Autentikasi kata sandi

`settings.py` bawaan dilengkapi dengan serangkaian [`AUTH_PASSWORD_VALIDATORS`](https://docs.djangoproject.com/id/stable/ref/settings/#std-setting-AUTH_PASSWORD_VALIDATORS) yang wajar yang memastikan bahwa kata sandi yang lemah tidak diperbolehkan. Anda dapat menyesuaikan pengaturan ini agar sesuai dengan kebijakan kata sandi Anda.

Selain itu Anda juga dapat memasang [django-zxcvbn-password-validator](https://github.com/Pierre-Sassoulas/django-zxcvbn-password-validator) yang memberikan perkiraan kesulitan kata sandi yang cukup realistis dan memungkinkan penolakan kata sandi di bawah ambang batas tertentu.

#### SEE ALSO
* [`PASSWORD_MINIMAL_STRENGTH`](https://docs.weblate.org/id/latest/admin/config.md#std-setting-PASSWORD_MINIMAL_STRENGTH)
* [`WEBLATE_MIN_PASSWORD_SCORE`](https://docs.weblate.org/id/latest/admin/install/docker.md#envvar-WEBLATE_MIN_PASSWORD_SCORE)
* [Keamanan kata sandi](https://docs.weblate.org/id/latest/security/passwords.md)

<a id="oidc-provider"></a>

## OpenID Connect identity provider

#### Versionadded
Added in version 2026.11.

Weblate can act as an optional OpenID Connect (OIDC) identity provider for
other applications. This is separate from signing in to Weblate using an
external OIDC provider.

Install the `oidc` extra (`uv pip install Weblate[oidc]`). Generate a
signing key and keep it outside version control:

```sh
openssl genrsa -out /path/to/oidc.key 4096
```

Enable [`OIDC_PROVIDER_ENABLED`](https://docs.weblate.org/id/latest/admin/config.md#std-setting-OIDC_PROVIDER_ENABLED), add the optional applications, and
configure [`OAUTH2_PROVIDER`](https://docs.weblate.org/id/latest/admin/config.md#std-setting-OAUTH2_PROVIDER) in your settings:

```python
from pathlib import Path

OIDC_PROVIDER_ENABLED = True
INSTALLED_APPS += ["weblate.oidc", "oauth2_provider"]
OAUTH2_PROVIDER = {
    "OIDC_RSA_PRIVATE_KEY": Path("/path/to/oidc.key").read_text(encoding="utf-8"),
}
```

Run [`migrate`](https://docs.weblate.org/id/latest/admin/management.md#weblate-admin-migrate) before starting Weblate and its workers. Disabled
installations do not need these applications, dependencies, or database tables.
For Docker, see [`WEBLATE_OIDC_PROVIDER_ENABLED`](https://docs.weblate.org/id/latest/admin/install/docker.md#envvar-WEBLATE_OIDC_PROVIDER_ENABLED).

Register each client in Django administration under
Applications. Select Authorization code and
RSA with SHA-256. For clients supporting a secret, select
Confidential and securely copy the generated client ID and secret.
Secrets are hashed when saved. For clients without a secret, select
Public; S256 PKCE is required for both client types. Register the
client's exact HTTPS callback URL. Only select
Skip authorization for trusted clients; other clients require user
consent before accessing identity information.

The issuer is the canonical Weblate site URL followed by `/oidc`, including
any [`URL_PREFIX`](https://docs.weblate.org/id/latest/admin/config.md#std-setting-URL_PREFIX). The discovery URL is the issuer followed by
`/.well-known/openid-configuration`. Configure clients to use this discovery
URL, authorization code flow, S256 PKCE, and scopes `openid profile email`.
Confidential-client authentication supports HTTP Basic or a form-encoded
client secret. For Zammad, register a public client, set its issuer to the
Weblate issuer URL, select `sub` as the UID field, request
`openid profile email`, and enable PKCE. Its callback is
`https://zammad.example.com/auth/openid_connect/callback`. Nextcloud's
`user_oidc` app can use a confidential client with the discovery URL.
Shared logout and automatic client registration are not provided.

Authorization requests can use GET or form-encoded POST. Clients exchange tokens
and fetch UserInfo through their servers.

Clients can request fresh authentication using `prompt=login` or limit the
age of the existing authentication using `max_age` in seconds. The limit
also applies when submitting consent. `max_age=0` always requires a new login.
With `prompt=none`, Weblate returns `login_required` or `consent_required`
when authentication or consent needs user interaction.

Federated sign-in can reuse an upstream session without revealing its
authentication time. These sign-ins omit `auth_time` from ID tokens and
cannot satisfy `prompt=login` or `max_age` requests; Weblate returns
`login_required` instead. Use a password-based sign-in or e-mail verification
when fresh authentication is required. A failed freshness request does not
prevent later ordinary federated sign-ins.

The `sub` claim is the Weblate user ID as a string, stable across username
and e-mail changes. The `profile` scope adds `preferred_username`, `name`,
and `family_name`; both name claims contain Weblate's full name. The `email`
scope adds `email` and `email_verified`. Verification is reported only when
the current address has a recorded verification. Claims are available in
ID tokens and from `/oidc/userinfo/` using an access token.

When [Modul hukum](https://docs.weblate.org/id/latest/admin/optionals.md#legal) is installed, clients can additionally request the optional
`weblate:legal` scope. It adds `weblate_tos_version` to ID tokens and
UserInfo, containing the version the user actually accepted as an ISO date,
for example `"2026-09-01"`. Older accepted versions are returned unchanged;
the claim is omitted when no acceptance is recorded. Reading it does not
record consent or expose the acceptance timestamp, IP address, or user agent.
Without the legal module, this scope is unavailable.

Receiving servers using the same legal package, such as `wllegal`, can use
this date to match their legal version. They must explicitly trust the issuer
and match the accepted version to their own documents before suppressing
local confirmation. This provider only exposes the information; accepting
shared consent on receiving Weblate servers requires separate integration.

New browser sessions created for OIDC sign-in expire after 60 seconds,
including when sign-in requires [Autentikasi dua faktor](#fa). Existing browser sessions keep
their expiry policy. Sessions created before the provider recorded an
authentication time require a fresh sign-in before authorizing a client.
If the browser session expires while the consent page is open, submitting
the form restarts sign-in and displays a new consent page. The earlier
approval or denial is discarded; the user must submit the new form.
Concurrent authorization attempts are tracked separately. Pending attempts
expire after 15 minutes; starting more than 16 discards the oldest attempt.

Access and ID tokens last one hour. Refresh tokens rotate
on use and expire after 30 days of inactivity beyond their associated access
token's expiry. ID tokens retain the original authentication time across
refreshes, including its absence for federated sign-ins, even when the user
signs in again elsewhere. Reusing an already
rotated refresh token revokes its token
family. Tokens work independently of the browser session and do not authorize
Weblate REST API access. Account removal deletes provider credentials, and
inactive accounts cannot authorize or use provider tokens. Celery periodically
cleans expired credentials.

To rotate signing keys, replace `OIDC_RSA_PRIVATE_KEY` and retain old private
keys in `OIDC_RSA_PRIVATE_KEYS_INACTIVE` until outstanding ID tokens and
cached key sets have expired. Only public key material is published by JWKS.

When migrating a client from SAML, explicitly map its existing identities to
the OIDC issuer and subject. Do not assume SAML NameIDs equal OIDC subjects,
or link accounts solely by matching e-mail addresses. For weblate.org, existing
accounts are linked by persistent SAML provider/identity pairs; its client
integration and identity mapping require a separate migration.

<a id="saml-auth"></a>

## Autentikasi SAML

#### Versionadded
Added in version 4.1.1.

#### Versionchanged
Berubah pada versi 5.12: Dependensi untuk autentikasi SAML tidak lagi disertakan dalam ekstra `all` bawaan. Anda perlu menyertakan `saml` saat memasang paket Weblate menggunakan pip (`uv pip install Weblate[all,saml]`).

Silakan ikuti petunjuk Python Social Auth untuk mengkonfigurasikan. Perbedaan penting:

* Weblate mendukung IDP tunggal yang harus disebut `weblate` dalam `SOCIAL_AUTH_SAML_ENABLED_IDPS`.
* URL metadata SAML XML adalah `/accounts/metadata/saml/`, yang juga merupakan ID entitas.
* URL masuk adalah `/accounts/complete/saml/` (juga dikenal sebagai URL ACS).
* Pengaturan berikut diiisi secara otomatis: `SOCIAL_AUTH_SAML_SP_ENTITY_ID`, `SOCIAL_AUTH_SAML_TECHNICAL_CONTACT`, `SOCIAL_AUTH_SAML_SUPPORT_CONTACT`

Contoh konfigurasi:

```default
# Authentication configuration
AUTHENTICATION_BACKENDS = (
    "social_core.backends.email.EmailAuth",
    "social_core.backends.saml.SAMLAuth",
    "weblate.accounts.auth.WeblateUserBackend",
)

# Social auth backends setup
SOCIAL_AUTH_SAML_SP_ENTITY_ID = f"https://{SITE_DOMAIN}/accounts/metadata/saml/"
SOCIAL_AUTH_SAML_SP_PUBLIC_CERT = "-----BEGIN CERTIFICATE-----"
SOCIAL_AUTH_SAML_SP_PRIVATE_KEY = "-----BEGIN PRIVATE KEY-----"
SOCIAL_AUTH_SAML_ENABLED_IDPS = {
    "weblate": {
        "entity_id": "https://idp.testshib.org/idp/shibboleth",
        "url": "https://idp.testshib.org/idp/profile/SAML2/Redirect/SSO",
        "x509cert": "MIIEDjCCAvagAwIBAgIBADA ... 8Bbnl+ev0peYzxFyF5sQA==",
    }
}
SOCIAL_AUTH_SAML_ORG_INFO = {
    "en-US": {
        "name": "example",
        "displayname": "Example Inc.",
        "url": "http://example.com"
    }
}
SOCIAL_AUTH_SAML_TECHNICAL_CONTACT = {
    "givenName": "Tech Gal",
    "emailAddress": "technical@example.com"
}
SOCIAL_AUTH_SAML_SUPPORT_CONTACT = {
    "givenName": "Support Guy",
    "emailAddress": "support@example.com"
}
```

Anda dapat menghasilkan pasangan kunci baru menggunakan:

```sh
openssl req -newkey rsa:4096 -new -x509 -days 3652 -nodes -out saml.crt -keyout saml.key
```

Konfigurasi bawaan mengekstrak rincian pengguna dari atribut berikut, konfigurasikan IdP Anda untuk menyediakannya:

| Atribut       | Referensi URI SAML                  |
|---------------|-------------------------------------|
| Nama lengkap  | `urn:oid:2.5.4.3`                   |
| Nama depan    | `urn:oid:2.5.4.42`                  |
| Nama belakang | `urn:oid:2.5.4.4`                   |
| Surel         | `urn:oid:0.9.2342.19200300.100.1.3` |
| Nama pengguna | `urn:oid:0.9.2342.19200300.100.1.1` |

Saat mengkonfigurasikan Weblate SP di IdP Anda, disarankan untuk memilih Format ID nama yang persisten.

#### HINT
Beberapa penyedia identitas (seperti Microsoft Entra ID dengan autentikasi multifaktor) memerlukan penonaktifan `requestedAuthnContext` bawaan di konfigurasi keamanan SAML:

```python
SOCIAL_AUTH_SAML_SECURITY_CONFIG = {"requestedAuthnContext": False}
```

In Docker, set [`WEBLATE_SAML_SECURITY_CONFIG`](https://docs.weblate.org/id/latest/admin/install/docker.md#envvar-WEBLATE_SAML_SECURITY_CONFIG) instead.

#### HINT
Contoh di atas dan gambar Docker mendefinisikan sebuah IdP bernama `weblate`. Anda mungkin perlu mengkonfigurasikan string ini sebagai Relay di IdP Anda.

#### NOTE
Autentikasi Weblate bergantung pada parameter `RelayState` yang akan diteruskan melalui proses autentikasi. Parameter ini perlu dikonfigurasi dengan beberapa penyedia identitas:

* [Cara Mengirim RelayState Kustom dengan Okta](https://support.okta.com/help/s/article/How-to-send-a-custom-relaystate-to-application-through-idp-initiated-authentication-urls)

#### SEE ALSO
* [Mengkonfigurasikan SAML di Docker](https://docs.weblate.org/id/latest/admin/install/docker.md#docker-saml)
* [SAML](https://python-social-auth.readthedocs.io/en/latest/backends/saml.html)

<a id="ldap-auth"></a>

## Autentikasi LDAP

Autentikasi LDAP dapat dicapai dengan baik menggunakan paket django-auth-ldap. Anda dapat memasangnya melalui cara biasa:

```sh
# Using PyPI
uv pip install 'django-auth-ldap>=1.3.0'

# Using apt-get
apt-get install python-django-auth-ldap
```

#### HINT
Paket ini sudah termasuk dalam kontainer Docker, lihat [Memasang menggunakan Docker](https://docs.weblate.org/id/latest/admin/install/docker.md).

#### NOTE
Ada beberapa ketidakcocokan dalam modul Python LDAP 3.1.0, yang mungkin mencegah Anda untuk menggunakan versi tersebut. Jika Anda mendapatkan galat [AttributeError: 'module' object has no attribute '_trace_level'](https://github.com/python-ldap/python-ldap/issues/226), menurunkan versi python-ldap ke 3.0.0 mungkin akan membantu.

Setelah Anda memasang paket, Anda dapat mengaitkannya ke dalam autentikasi Django:

```python
# Add LDAP backed, keep Django one if you want to be able to sign in
# even without LDAP for admin account
AUTHENTICATION_BACKENDS = (
    "django_auth_ldap.backend.LDAPBackend",
    "weblate.accounts.auth.WeblateUserBackend",
)

# LDAP server address
AUTH_LDAP_SERVER_URI = "ldaps://ldap.example.net"

# DN to use for authentication
AUTH_LDAP_USER_DN_TEMPLATE = "cn=%(user)s,o=Example"
# Depending on your LDAP server, you might use a different DN
# like:
# AUTH_LDAP_USER_DN_TEMPLATE = 'ou=users,dc=example,dc=com'

# List of attributes to import from LDAP upon sign in
# Weblate stores full name of the user in the full_name attribute
AUTH_LDAP_USER_ATTR_MAP = {
    "full_name": "name",
    # Use the following if your LDAP server does not have full name
    # Weblate will merge them later
    # 'first_name': 'givenName',
    # 'last_name': 'sn',
    # Email is required for Weblate (used in VCS commits)
    "email": "mail",
}
# Optional: route "Forgot your password?" to your LDAP self-service page
PASSWORD_RESET_URL = "https://id.example.net/password-reset/"


# Hide the registration form
REGISTRATION_OPEN = False
```

#### NOTE
Anda harus menghapus `'social_core.backends.email.EmailAuth'` dari pengaturan [`AUTHENTICATION_BACKENDS`](https://docs.djangoproject.com/id/stable/ref/settings/#std-setting-AUTHENTICATION_BACKENDS). Jika tidak, pengguna akan dapat mengatur kata sandi mereka di Weblate, dan mengautentikasikan menggunakan itu. Mempertahankan `'weblate.accounts.auth.WeblateUserBackend'` tetap diperlukan untuk memberikan izin dan memfasilitasikan pengguna anonim. Ini juga akan memungkinkan Anda untuk masuk menggunakan akun admin lokal, jika Anda telah membuatnya (mis. dengan menggunakan [`createadmin`](https://docs.weblate.org/id/latest/admin/management.md#weblate-admin-createadmin)).

### Menggunakan kata sandi pengikat

Jika Anda tidak dapat menggunakan pengikatan langsung untuk autentikasi, Anda perlu menggunakan pencarian, dan menyediakan pengguna untuk diikat untuk pencarian. Contoh:

```python
import ldap
from django_auth_ldap.config import LDAPSearch

AUTH_LDAP_BIND_DN = ""
AUTH_LDAP_BIND_PASSWORD = ""
AUTH_LDAP_USER_SEARCH = LDAPSearch(
    "ou=users,dc=example,dc=com", ldap.SCOPE_SUBTREE, "(uid=%(user)s)"
)
```

### Integrasi Active Directory

```python
import ldap
from django_auth_ldap.config import LDAPSearch, NestedActiveDirectoryGroupType

AUTH_LDAP_BIND_DN = "CN=ldap,CN=Users,DC=example,DC=com"
AUTH_LDAP_BIND_PASSWORD = "password"

# User and group search objects and types
AUTH_LDAP_USER_SEARCH = LDAPSearch(
    "CN=Users,DC=example,DC=com", ldap.SCOPE_SUBTREE, "(sAMAccountName=%(user)s)"
)

# Make selected group a superuser in Weblate
AUTH_LDAP_USER_FLAGS_BY_GROUP = {
    # is_superuser means user has all permissions
    "is_superuser": "CN=weblate_AdminUsers,OU=Groups,DC=example,DC=com",
}

# Map groups from AD to Weblate
AUTH_LDAP_GROUP_SEARCH = LDAPSearch(
    "OU=Groups,DC=example,DC=com", ldap.SCOPE_SUBTREE, "(objectClass=group)"
)
AUTH_LDAP_GROUP_TYPE = NestedActiveDirectoryGroupType()
AUTH_LDAP_FIND_GROUP_PERMS = True

# Optionally enable group mirroring from LDAP to Weblate
# AUTH_LDAP_MIRROR_GROUPS = True
```

#### SEE ALSO
* [Django Authentication Using LDAP](https://django-auth-ldap.readthedocs.io/en/latest/index.html)
* [Authentication](https://django-auth-ldap.readthedocs.io/en/latest/authentication.html)

<a id="cas-auth"></a>

## Autentikasi CAS

Autentikasi CAS dapat dicapai menggunakan paket seperti [Django CAS NG](https://github.com/django-cas-ng/django-cas-ng).

Langkah pertama adalah mengungkapkan kolom surel pengguna melalui CAS. Ini harus dikonfigurasikan pada server CAS itu sendiri dan mengharuskan Anda untuk menjalankan setidaknya CAS v2 karena CAS v1 tidak mendukung atribut sama sekali.

Langkah kedua adalah memperbarui Weblate untuk menggunakan server dan atribut CAS Anda.

Untuk memasang [Django CAS NG](https://github.com/django-cas-ng/django-cas-ng):

```sh
uv pip install django-cas-ng
```

Setelah Anda memiliki paket yang terpasang, Anda dapat mengaitkannya dengan sistem autentikasi Django dengan memodifikasi berkas `settings.py`:

```python
# Add CAS backed, keep the Django one if you want to be able to sign in
# even without LDAP for the admin account
AUTHENTICATION_BACKENDS = (
    "django_cas_ng.backends.CASBackend",
    "weblate.accounts.auth.WeblateUserBackend",
)

# CAS server address
CAS_SERVER_URL = "https://cas.example.net/cas/"

# Add django_cas_ng somewhere in the list of INSTALLED_APPS
INSTALLED_APPS = (..., "django_cas_ng")
```

Akhirnya, sebuah sinyal dapat digunakan untuk memetakan kolom surel ke objek pengguna. Agar ini bekerja, Anda harus mengimpor sinyal dari paket django-cas-ng dan menghubungkan kode Anda dengan sinyal ini. Melakukan hal ini di berkas pengaturan dapat menyebabkan masalah, oleh karena itu disarankan untuk meletakkannya:

- Di dalam metode [`django.apps.AppConfig.ready()`](https://docs.djangoproject.com/id/stable/ref/applications/#django.apps.AppConfig.ready) konfigurasi aplikasi Anda
- Di dalam berkas `urls.py` proyek (ketika tidak ada model yang ada)

```python
from django_cas_ng.signals import cas_user_authenticated
from django.dispatch import receiver


@receiver(cas_user_authenticated)
def update_user_email_address(sender, user=None, attributes=None, **kwargs):
    # If your CAS server does not always include the email attribute
    # you can wrap the next two lines of code in a try/catch block.
    user.email = attributes["email"]
    user.save()
```

## Mengkonfigurasikan autentikasi Django pihak ketiga

Umumnya setiap pengaya autentikasi Django harus bekerja dengan Weblate. Cukup ikuti petunjuk untuk pengaya tersebut, ingatlah untuk tetap memasang backend pengguna Weblate.

#### SEE ALSO
* [Autentikasi LDAP](#ldap-auth)
* [Autentikasi CAS](#cas-auth)

Biasanya pemasangan akan terdiri dari penambahan backend autentikasi ke [`AUTHENTICATION_BACKENDS`](https://docs.djangoproject.com/id/stable/ref/settings/#std-setting-AUTHENTICATION_BACKENDS) dan memasang aplikasi autentikasi (jika ada) ke dalam [`INSTALLED_APPS`](https://docs.djangoproject.com/id/stable/ref/settings/#std-setting-INSTALLED_APPS):

```python
AUTHENTICATION_BACKENDS = (
    # Add authentication backend here
    "weblate.accounts.auth.WeblateUserBackend",
)

INSTALLED_APPS += (
    # Install authentication app here
)
```

<a id="fa"></a>

# Autentikasi dua faktor

#### Versionadded
Added in version 5.7.

#### HINT
Autentikasi dua faktor menambahkan lapisan keamanan lain pada akun Anda dengan memerlukan lebih dari sekadar kata sandi untuk masuk.

Weblate mendukung faktor kedua berikut:

Kunci keamanan (WebAuthn)
: Keduanya, Kunci sandi dan kunci keamanan didukung.
  <br/>
  Kunci sandi memvalidasikan identitas Anda menggunakan sentuhan, pengenalan wajah, kata sandi perangkat, atau PIN karena kunci sandi mencakup verifikasi pengguna.
  <br/>
  Kunci keamanan adalah kredensial WebAuthn yang hanya dapat digunakan sebagai faktor kedua autentikasi, dan ini hanya memvalidasikan keberadaan pengguna.
  <br/>
  When signing in on a new computer or in a different browser, your passkey
  might not be available. Use a device where the passkey is available, or
  connect your registered security key. A verification error can mean that
  the request timed out, was canceled, or that the credential is unavailable;
  it does not identify the exact cause.
  <br/>
  You can also select another configured verification method on the sign-in
  page, such as Use recovery codes. If you cannot use any configured
  method, contact the site administrator for help.

Aplikasi autentikator (TOTP)
: Aplikasi autentikator dan ekstensi peramban seperti Aegis, Bitwarden, Google Authenticator, 1Password, Authy, Microsoft Authenticator, dsb. menghasilkan kata sandi sekali pakai berbasis waktu yang digunakan sebagai faktor kedua untuk memverifikasi identitas Anda saat diminta saat masuk.
  <br/>
  Registration becomes active only after you verify a code from the app.
  Complete registration within 10 minutes of confirming your sign-in method;
  otherwise confirm it again and use the new QR code. Each registration can be
  completed only once. After registering, wait for the next code before using
  the app to sign in.
  <br/>
  Only one registration can be pending per account. Confirming your sign-in
  method in another browser session invalidates the pending QR code and starts
  a new registration.
  <br/>
  If you have more than one registered authenticator app, select the app
  you are using when entering its code during sign-in.

Kode pemulihan
: Kode pemulihan dapat digunakan untuk mengakses akun Anda jika Anda kehilangan akses ke perangkat dan tidak dapat menerima kode autentikasi dua faktor.
  <br/>
  Jaga keamanan kode pemulihan Anda sama seperti keamanan kata sandi Anda. Kami sarankan menyimpannya dengan pengelola kata sandi seperti Bitwarden, 1Password, Authy, atau Keeper.

Each user can configure this in [Keamanan](https://docs.weblate.org/id/latest/user/profile.md#profile-security) and second factor will
be required to sign in addition to the existing authentication method.

Before registering the first authenticator app or security key, confirm your
existing sign-in method. Enter your current password, including one verified
by a configured Django authentication backend such as LDAP, or sign in again
through an already connected provider. If neither method is available, contact
an administrator to recover access. Registering a new factor does not count as a
recent second-factor verification for other sensitive actions, such as creating
a project token; complete a separate second-factor challenge for those actions.

Viewing the personal API key and changing credentials, access permissions, or
account status requires credential verification from the last 10 minutes in a
browser session. This includes managing project members and tokens, teams,
roles, user accounts, and project and component visibility. Weblate prompts for
a second factor when one is configured. Otherwise, enter your current password,
verify through a configured Django authentication backend, or sign in again through
an already connected provider. Account deletion still
requires confirmation through a link sent to your e-mail address. API token
requests continue to use token authentication.

This can be enforced for users at the project (see [Autentikasi dua faktor yang dipaksakan](https://docs.weblate.org/id/latest/admin/projects.md#project-enforced-2fa))
or team level. In site-wide deployments, this can also be used to enforce
two-factor authentication for all users by enabling it on the default
Users team, which is assigned automatically to new users by
[automatic team assignment](https://docs.weblate.org/id/latest/admin/access.md#autoteam).

Izin tim dengan autentikasi dua faktor yang dipaksakan tidak akan diterapkan kepada pengguna yang tidak mengkonfigurasikannya.
