The provided content is a **release notes document** for **Logto**, a developer-focused identity platform. It details 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 (Security)**
- **Change**: SAML assertions are now validated against the **Audience URI (SP Entity ID)** of the connector.
- **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**: Prevents spoofing and ensures assertions are intended for the correct service provider.

---

### 2. **Account API & Third-Party Applications (Security)**
- **Change**: 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 uses stored provider tokens, switch to a **first-party app**.

---

### 3. **Connector Request Errors (Privacy & Security)**
- **Change**: When a connector makes an outbound request (e.g., network timeout), the error is now **sanitized**.
- **What’s Removed**:
  - Request bodies
  - Headers
  - Query strings
- **What’s Kept**:
  - Error name, code, message
  - Request method
  - Origin and pathname of the URL
- **Purpose**: Reduces exposure of sensitive data in logs and telemetry.

---

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

---

### 5. **SAML Applications (Validation & Error Handling)**
- **Change**: Reject malformed SAML XML with a **400 error** (`application.saml.invalid_saml_request`).
- **Examples of Invalid XML**:
  - Unescaped `&`
  - Mismatched tags
- **Audit Log**: Records the format error under `samlRequestError`.
- **Note**: Previously, such errors would return a 500; now they return 400 unless signed authentication is required.

---

### 6. **Logto Tunnel (`@logto/tunnel` v0.3.12)**
- **Security Hardening**:
  - **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 (Performance & Usability)**
- **Change**:
  - `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**.
- **Purpose**: Prevents performance issues with large payloads.

---

## 🐛 **Bug Fixes & Stability**

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

### 2. **Social Sign-in**
- **Unreachable Provider**:
  - Returns `502 connector.social_provider_unreachable` instead of 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 the **actual error message** from the provider 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 spaces.
  - A `scope` with only spaces is treated as **omitted**.

### 4. **Management API**
- **Unknown `customClientMetadata` Keys**:
  - Now rejected with `400 guard.invalid_input` and lists the invalid key.
  - Prevents typos (e.g., `refreshTokenTtlInDay`) from being silently ignored.
- **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. **SAML Applications**
- **Attribute Placeholders**:
  - Fixed issue where attributes like `o365role` were sent as literal `{attr…}` instead of the user’s value.

### 6. **Console & Account Center**
- **Application Access Control**:
  - Organization selector now **filters results** when searching.
- **Role Permissions**:
  - API resource names now shown in full.
  - Truncated names have **tooltips**.
- **Account Center Branding**:
  - No longer shows "Powered by Logto" during loading when branding is hidden.

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

---

## 🔄 **Connectors**

### 1. **Standard OAuth 2.0 & OIDC**
- **String `expires_in`**: Now accepted (e.g., from Criipto).
- **JSON Array `scope`**: Now accepted (e.g., from Twitch), normalized to space-delimited string.

### 2. **Patreon**
- **Fix**: Patreon v1 API removed → now uses **v2 identity endpoint**.
- **Result**: Patreon sign-in now works again.

### 3. **Connector Kit**
- **Performance**: `jsonGuard` and `jsonObjectGuard` now build schema **once**, not per nested value.
- **Result**: Faster validation for large JSON payloads.

---

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

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

### 2. **Node.js 26**
- **Docker Image**: Now runs on **Node.js 26**.
- **Supported Versions**: 22, 24, 26 (minimums: 22.23.4, 24.22.1, 26.12.1).
- **Security**: Includes **October 2026 Node.js security fixes**.

### 3. **Database Migration Required**
- **Schema Changes**:
  - New columns for SAML static attributes
  - New sign-in experience and Account Center settings
- **Action**: Run:
  ```bash
  npm run alteration deploy
  # or
  logto db alteration deploy
  ```
- **Note**: Do this **before** starting the new version.

### 4. **Database Connection Retries**
- **At Startup**: Retries on DNS failures (`ENOTFOUND`, `EAI_AGAIN`) instead of exiting.
- **CLI Commands**: `db seed`, `db alteration deploy` now retry transient errors (including DNS).

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

---

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

| Contributor | Contributions |
|-----------|---------------|
| [@nicolaj0](https://github.com/nicolaj0) | Webhook `deliveryId`, `hasPassword`, organization filter, `customClientMetadata` validation, unreachable social errors, declined authorization errors, database 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**

| Task | Description |
|------|-------------|
| 🔐 **Security** | Ensure SAML audience matches SP Entity ID; switch to first-party apps for Account API. |
| 🛠️ **Upgrade** | Run `logto db alteration deploy` after upgrading. |
| 📦 **Node.js** | Ensure Node.js 26+ is used (minimum version: 26.12.1). |
| 🧪 **Testing** | Test SAML, social sign-in, and OAuth flows after upgrade. |
| 📚 **Docs** | Update Swift integration guide if using it. |

---

This release focuses on **security hardening**, **privacy**, **stability**, and **developer experience**. Be sure to review the **database migration** and **security changes** before upgrading.