The provided content is a **release notes document** for **Logto**, a developer-focused identity platform. It details the changes, improvements, bug fixes, and updates in a specific version (likely **v1.46.0**) of the Logto platform.

Here's a breakdown of the key sections and what they mean:

---

### 🔐 **Security Hardening & Important Changes**

These are critical updates that may affect existing deployments or integrations.

#### 1. **SAML Assertion Audience**
- **Change**: SAML assertions now require the `Audience` value to **exactly match** the connector’s **Audience URI (SP Entity ID)**.
- **Impact**: After upgrading, if SAML sign-in fails with `"SAML assertion audience does not match the SP entity ID"`, you must:
  - Go to your **Identity Provider (IdP)** settings.
  - Set the **Audience** to match the **SP Entity ID** shown in the Logto connector settings.
- **Why it matters**: This improves security by ensuring SAML responses are only accepted by the intended service.

#### 2. **Account API & Third-Party Apps**
- **Change**: All Account API operations (e.g., retrieving tokens, reading backup codes) now **require a first-party app**.
- **Impact**:
  - **Third-party apps** will get a `403 auth.third_party_application_forbidden` error.
  - **First-party apps** (like Account Center, Console) are unaffected.
- **Action Required**: If your integration uses a third-party app to access stored tokens, **switch to a first-party app**.

#### 3. **Connector Request Errors (Privacy)**
- **Change**: When a connector request fails (e.g., network timeout), **sensitive data (headers, body, query strings)** is no longer logged or returned.
- **What’s kept**:
  - Error name, code, message.
  - Request method and URL (origin + pathname).
- **Why it matters**: Enhances privacy and reduces exposure of sensitive data in logs.

#### 4. **Single-Use Codes & Tokens**
- **Change**: Authorization codes, device codes, pushed auth requests, and one-time tokens can now be used **only once**.
- **Error on reuse**: `invalid_grant`, `invalid_request_uri`, or `one_time_token.token_consumed`.
- **Exception**: Refresh tokens still allow reuse within their window.
- **Why it matters**: Prevents replay attacks and improves security.

#### 5. **SAML Request Validation**
- **Change**: Malformed SAML XML (e.g., unescaped `&`, mismatched tags) now returns a **400 error** (`application.saml.invalid_saml_request`) instead of a 500.
- **Audit log**: Includes the format error under `samlRequestError`.
- **Why it matters**: Better error handling and security.

---

### 🛠️ **New Features & Improvements**

#### 1. **Connector Branding Before Email Match**
- **New Setting**: `Show SSO connector names and logos before email match`
- **Location**: `Console > Sign-in experience > Sign-up and sign-in > Advanced options`
- **Default**: On (current behavior).
- **Use case**: Hide SSO options until a user’s email domain matches a known domain.

#### 2. **Logto Tunnel (v0.3.12)**
- **Security**: Symlinks are resolved before serving files. If a symlink points outside the `--experience-path`, it returns **404**.
- **Range Header**: If a `Range` exceeds file size, it’s clamped. Unsatisfiable ranges return **416**.
- **Why it matters**: Prevents directory traversal and improves security.

#### 3. **Request Validation**
- **Limit**: Only the **first 100 validation issues** are shown in `guard.invalid_input` errors.
- **Performance**: Stops validating after 100 invalid fields in `POST /callback` endpoints.

---

### 🐛 **Bug Fixes & Stability**

#### 1. **Sign-in Experience**
- **Fix**: No more blank sign-in pages on **older Safari/iOS (pre-16.4)**.
- **Now**: Compiled for iOS 15+ and Safari 15+.

#### 2. **Social Sign-in**
- **Unreachable Provider**: Returns `502 connector.social_provider_unreachable` with network error and connector ID.
- **Declined Authorization**: Returns `401 connector.authorization_failed` with provider-specific error (e.g., `access_denied`, `user_cancelled_authorize`).
- **Provider Errors**: Now show actual error messages instead of `{}`.

#### 3. **OAuth & OIDC**
- **Fix**: Leading/trailing spaces in `scope` are now ignored. A `scope` with only spaces is treated as omitted.

#### 4. **Management API**
- **Custom Metadata**: Rejects unknown keys in `customClientMetadata` with `400 guard.invalid_input`.
- **Pagination Links**: Now preserve repeated query parameters (e.g., `?types=SPA&types=Traditional`).
- **One-Time Token Count**: `Total-Number` header now reflects filtered results.
- **Manual Unlock**: Clears long-term security verification lockouts (>60 min).

#### 5. **SAML Applications**
- **Fix**: Attribute placeholders like `{attr.o365role}` now return the actual user value.

#### 6. **Console & Account Center**
- **App Access Control**: Organization selector now filters during search.
- **Role Permissions**: Full API resource names shown; tooltips for truncated names.
- **Account Center**: No "Powered by Logto" during loading when branding is hidden.

#### 7. **Documentation**
- **Swift Guide**: Fixed `Cannot find 'client' in scope` by using consistent client names.

#### 8. **Connectors**
- **OAuth 2.0 / OIDC**:
  - Accepts `expires_in` as a string (e.g., from Criipto).
  - Accepts `scope` as a JSON array (e.g., from Twitch), normalizing to space-delimited string.
- **Patreon**: Now uses v2 API (v1 deprecated), so sign-in works again.
- **Connector Kit**: `jsonGuard` and `jsonObjectGuard` now build schema once, improving performance.

---

### 🖥️ **Self-Hosting & OSS Notes**

#### 1. **Review Before Upgrading**
- Check:
  - OAuth 2.0 & Azure AD email sync.
  - SAML audience.
  - Third-party Account API changes.

#### 2. **Node.js 26**
- **Docker image** now runs on **Node.js 26**.
- **Supported versions**: 22, 24, 26 (with minimum versions: 22.23.4, 24.22.1, 26.12.1).
- **Security**: Includes October 2026 fixes.

#### 3. **Database Migration Required**
- **Schema changes**: New columns for SAML static attributes and new sign-in/Account Center settings.
- **Action**: Run `npm run alteration deploy` or `logto db alteration deploy` **before** starting the new version.
- **Link**: [Upgrade Guide](https://docs.logto.io/logto-oss/upgrading-oss-version)

#### 4. **Database Connection Retries**
- **Now**: Retries on DNS failures (`ENOTFOUND`, `EAI_AGAIN`) at startup and CLI commands.
- **Before**: Would exit immediately.

#### 5. **Admin Endpoint Warning**
- **New**: Logs a warning if a `/console` request reaches the default tenant due to mismatched `ADMIN_ENDPOINT`.
- **Action**: Check Console URL and `ADMIN_ENDPOINT` environment variable.

---

### 🙌 **Contributors**
Huge thanks to:
- **@nicolaj0** – Multiple contributions (webhooks, metadata validation, error handling, DNS retries).
- **@RaphaelFakhri** – First contribution: pagination links.
- **@mvanhorn** – `ADMIN_ENDPOINT` warning.
- **@timokoethe** – Swift guide consistency.

---

### 🔗 **Full Changelog**
- [Compare v1.45.0 → v1.46.0](https://github.com/logto-io/logto/compare/v1.45.0...v1.46.0)

---

### ✅ **Summary: What You Should Do**
1. **Check SAML Audience** if sign-in fails.
2. **Switch to first-party apps** for Account API access.
3. **Run database migration** (`logto db alteration deploy`) after upgrading.
4. **Update Node.js** to 26 (or 22/24) if self-hosting.
5. **Review `ADMIN_ENDPOINT`** if seeing console warnings.
6. **Test social sign-in** and **SAML** flows after upgrade.

This release focuses on **security**, **privacy**, **stability**, and **developer experience**.