The provided content is a **release notes document** for **Logto**, a developer-focused identity platform. It details the changes, improvements, bug fixes, and security updates in a specific version (likely **v1.46.0**, based on the changelog link). Below is a **structured summary** of the key points, organized by category for clarity and ease of understanding.

---

## 🔧 **Key Changes & Security Hardening**

### 1. **SAML Assertion Audience**
- **Change**: SAML assertions are now validated against the **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:
  - Set the **Audience** at your identity provider (IdP) to match the **SP Entity ID** in the connector settings.
- **Purpose**: Enhances security by ensuring SAML assertions are only accepted for the intended service provider.

---

### 2. **Account API & Third-Party Applications**
- **New Requirement**: All Account API operations now require a **first-party application**.
- **Affected Endpoints**:
  - `GET /api/my-account/identities/:target/access-token`
  - `GET /api/my-account/sso-identities/:connectorId/access-token`
  - `PUT /api/my-account/identities/:target/access-token`
  - Reading backup codes, sessions, grants, and trusted devices.
- **Error for Third-Party Apps**: `403 auth.third_party_application_forbidden`
- **Note**: First-party apps (e.g., Account Center, Console) are unaffected.
- **Action Required**: If your integration retrieves stored tokens, switch to a **first-party app**.

---

### 3. **Connector Request Errors**
- **Improved Privacy & Security**:
  - Request bodies, headers, and query strings are **no longer logged or exposed** in error responses.
  - Only the **error name, code, and message** are included.
  - Server logs retain the **request method** and **URL origin/pathname**.
- **Purpose**: Reduces exposure of sensitive data in logs and telemetry.

---

### 4. **Single-Use Codes and Tokens**
- **Behavior Change**: One-time tokens (authorization codes, device codes, pushed auth requests, one-time tokens) are now **accepted only once**.
- **Error on Reuse**:
  - `invalid_grant` for authorization codes
  - `invalid_request_uri` for pushed authorization requests
  - `one_time_token.token_consumed` for one-time tokens
- **Exception**: Refresh tokens still allow reuse within their window.

---

### 5. **SAML Applications**
- **Validation Improvements**:
  - Rejects malformed SAML XML (e.g., unescaped `&`, mismatched tags) with `400 application.saml.invalid_saml_request`.
  - Logs format errors in the audit log under `samlRequestError`.
  - Returns `400` instead of `500` for unparseable requests (unless signed authentication is required).
- **Fix**: Mapped attributes like `o365role` now return actual values instead of `{attr...}` placeholders.

---

### 6. **Logto Tunnel (`@logto/tunnel` v0.3.12)**
- **Security Enhancements**:
  - **Symlinks**: Resolved before serving; files outside the `--experience-path` return `404`.
  - **Range Headers**: If `Range` exceeds file size, it’s clamped; unsatisfiable ranges return `416`.
- **Purpose**: Prevents directory traversal and ensures safe static file serving.

---

### 7. **Request Validation**
- **Limits**:
  - `guard.invalid_input` now lists **only the first 100 validation issues**.
  - `POST /callback/:connectorId` and `POST /account/callback/social/:connectorId` stop validating after **100 invalid fields**.
- **Note**: Error response format remains unchanged.

---

## 🐞 **Bug Fixes & Stability Improvements**

### 1. **Sign-in Experience**
- **Fix**: Sign-in page no longer loads blank on **older Safari/iOS (pre-16.4)**.
- **Reason**: Now compiled for **iOS 15 and Safari 15+**.

---

### 2. **Social Sign-in**
- **Unreachable Provider**:
  - Returns `502 connector.social_provider_unreachable` instead of generic `500`.
  - Includes network error code and connector ID.
  - End users see a translated message.
- **Declined Authorization**:
  - Returns `401 connector.authorization_failed` with provider-specific `error` and `error_description`.
  - Covers cases like `access_denied`, `user_cancelled_authorize`, `user_cancelled_login`.
- **Provider Error Messages**:
  - Now shows actual provider error messages instead of `{}`.

---

### 3. **OAuth & OIDC**
- **Space-Padded Scopes**:
  - Fixes issue where clients like OpenAI Codex failed due to leading spaces in `scope` (e.g., `" offline_access"`).
  - Logto now **ignores empty scopes** caused by leading/trailing/repeated spaces.
  - A `scope` of only spaces is treated as **omitted**.

---

### 4. **Management API**
- **`customClientMetadata`**:
  - Rejects unknown keys with `400 guard.invalid_input`, listing the invalid key.
  - Prevents silent failures due to typos (e.g., `refreshTokenTtlInDay`).
- **Pagination Links**:
  - Now preserve **all values** of repeated query parameters (e.g., `?types=SPA&types=Traditional`) instead of joining them.
- **One-Time Token Count**:
  - `Total-Number` header now counts **only matching tokens** when filtered by `email` or `status`.
- **Manual Unlock**:
  - Clears **active security verification lockouts longer than 60 minutes**.
  - Documentation now mentions **user IDs** and **security verification lockouts**.

---

### 5. **Console & Account Center**
- **Application Access Control**:
  - Organization selector now **filters results** during search.
- **Role Permissions**:
  - Full API resource names shown; truncated names have **tooltips**.
- **Account Center Branding**:
  - No longer shows "Powered by Logto" during loading when branding is hidden.

---

### 6. **Documentation**
- **Swift Integration Guide**:
  - Fixed code examples to use consistent client name, resolving `Cannot find 'client' in scope` in Xcode.

---

### 7. **Connectors**
- **Standard 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**:
  - Replaced deprecated v1 API with **v2 identity endpoint**, restoring sign-in.
- **Connector Kit**:
  - `jsonGuard` and `jsonObjectGuard` now build schema **once**, improving performance for large JSON payloads.

---

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

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

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

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

### 4. **Database Connection Retries**
- **Core** now retries on DNS failures (`ENOTFOUND`, `EAI_AGAIN`) at startup.
- **CLI commands** (`db seed`, `db alteration deploy`) now retry transient errors, including DNS failures.

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

---

## 👥 **Contributors**
Huge thanks to the community for their contributions:

| Contributor | Contributions |
|-----------|---------------|
| [@nicolaj0](https://github.com/nicolaj0) | Webhook `deliveryId`, `hasPassword`, organization filter, `customClientMetadata` validation, social provider errors, DNS retries, connector request errors |
| [@RaphaelFakhri](https://github.com/RaphaelFakhri) | Repeated query parameters in pagination links (first contribution) |
| [@mvanhorn](https://github.com/mvanhorn) | `ADMIN_ENDPOINT` mismatch warning |
| [@timokoethe](https://github.com/timokoethe) | Consistent client name in Swift guide |

---

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

---

## ✅ **Summary of Action Items for Users**
1. **Upgrade** to v1.46.0.
2. **Run database migration** (`npm run alteration deploy`).
3. **Update SAML IdP audience** to match SP Entity ID.
4. **Switch third-party apps** to first-party apps for Account API access.
5. **Check `ADMIN_ENDPOINT`** if seeing console warnings.
6. **Review OAuth/SAML configurations** for compatibility.

---

This release focuses on **security hardening**, **privacy improvements**, **stability**, and **developer experience**. It’s a significant update for both self-hosted and cloud users.