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**, based on the changelog link). Below is a **structured summary** of the key points, organized by category for clarity and ease of understanding.

---

## 📢 **Overview**
This release focuses on **security hardening**, **stability improvements**, **enhanced error handling**, and **better developer experience**. It includes changes to SAML, OAuth, third-party app access, logging, and self-hosting.

---

## 🔐 **Security Hardening**

### 1. **SAML Assertion Audience**
- **Change**: SAML assertions are now validated against the **Audience URI (SP Entity ID)**.
- **Issue**: After upgrading, sign-in may fail with `"SAML assertion audience does not match the SP entity ID"`.
- **Fix**: Set the **Audience** at your identity provider (IdP) to match the **SP Entity ID** in the connector settings.

### 2. **Account API & Third-Party Apps**
- **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, trusted devices
- **Result for Third-Party Apps**: Returns `403 auth.third_party_application_forbidden`
- **Note**: First-party apps (e.g., Account Center, Console) are unaffected.

### 3. **Connector Request Errors**
- **Change**: Sensitive data (request bodies, headers, query strings) is **no longer logged or exposed**.
- **Only logged**: Error name, code, message, request method, and URL path.
- **Purpose**: Improve security and reduce log noise.

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

### 5. **SAML Applications**
- **Change**: Reject malformed SAML XML with `400 application.saml.invalid_saml_request`.
- **Improvements**:
  - Better error handling for malformed or unparsable SAML requests.
  - Audit log now includes `samlRequestError` for format issues.
  - Avoids 500 errors when SAML parsing fails (if signed requests are not required).

---

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

### 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**: Turn off to show SSO connectors only after email domain matches.

### 2. **Logto Tunnel (`@logto/tunnel` v0.3.12)**
- **Security Enhancements**:
  - **Symlinks**: Resolved before serving; files outside `--experience-path` return 404.
  - **Range Headers**: Clamped to file size; unsatisfiable ranges return 416.
- **Purpose**: Prevents directory traversal and improves static file serving safety.

### 3. **Request Validation**
- **Change**: Limits validation output:
  - `guard.invalid_input` now shows **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**

### 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 500.
  - Includes network error code and connector ID.
  - End users see translated messages.
- **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 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** from leading/trailing/repeated 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 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 **security verification lockouts longer than 60 minutes**.
  - API and UI now mention **user IDs** and **security verification lockouts**.

### 5. **SAML Applications**
- **Attribute Placeholders**:
  - Fixed issue where attributes like `o365role` were sent as literal `{attr…}` instead of user values.

### 6. **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.

### 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**
- **Token Response Fixes**:
  - 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.

### 2. **Patreon**
- **Fix**: Patreon v1 API removed; now uses **v2 identity endpoint**.
- **Result**: Patreon sign-in restored.

### 3. **Connector Kit**
- **Performance**: `jsonGuard` and `jsonObjectGuard` now build schema **once**, not per nested value.
- **Benefit**: 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 Support**
- **Docker Image**: Now runs on **Node.js 26**.
- **Supported Versions**: 22, 24, 26
- **Minimum Versions**:
  - 22.23.4
  - 24.22.1
  - 26.12.1
- **Note**: Includes **October 2026 security fixes**.

### 3. **Database Migration Required**
- **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.
- **Reference**: [Upgrade Guide](https://docs.logto.io/logto-oss/upgrading-oss-version)

### 4. **Database Connection Retries**
- **Improvement**: Retries on DNS failures (`ENOTFOUND`, `EAI_AGAIN`) at startup and during CLI commands (`db seed`, `db alteration deploy`).
- **Benefit**: More resilient startup and setup.

### 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` if seen.

---

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

| Contributor | Contributions |
|-----------|---------------|
| [@nicolaj0](https://github.com/nicolaj0) | Webhook `deliveryId`, `hasPassword`, organization filter, `customClientMetadata` validation, social 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**
- [Compare v1.45.0 → v1.46.0](https://github.com/logto-io/logto/compare/v1.45.0...v1.46.0)

---

## ✅ **Summary of Key Actions for Users**
| Action | Description |
|------|-------------|
| 🔧 **Upgrade** | Run `npm run alteration deploy` after upgrading. |
| 🔐 **Security** | Ensure SAML audience matches SP Entity ID. |
| 🛠️ **API Access** | Use **first-party apps** for Account API operations. |
| 🧪 **Testing** | Test SAML, social sign-in, and OAuth flows post-upgrade. |
| 📦 **Node.js** | Ensure Node.js version ≥ 22.23.4 (or 24.22.1 / 26.12.1). |

---

Let me know if you'd like a **cheat sheet**, **upgrade checklist**, or **FAQ** based on this release!