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.

---

## 🔐 **Security Hardening & Policy Changes**

### 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**: Prevents spoofing and ensures trust between the IdP and SP.

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

### 3. **Connector Request Errors**
- **Privacy Enhancement**: When a connector request fails (e.g., timeout), the error is now **sanitized**:
  - Only the **error name, code, and message** are logged/exported.
  - **Request bodies, headers, and query strings are removed**.
- **Exception**: Server logs still include the **request method**, **origin**, and **pathname**.
- **Purpose**: Reduces exposure of sensitive data in logs and telemetry.

### 4. **Single-Use Codes and Tokens**
- **New Rule**: 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.

---

## 🛠️ **New Features & Enhancements**

### 1. **SAML Applications**
- **Improved Validation**:
  - 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 (if not signed).
- **Attribute Fix**: Mapped attributes like `o365role` now return the **actual user value** instead of the placeholder `{attr...}`.

### 2. **Logto Tunnel (`@logto/tunnel` v0.3.12)**
- **Security Improvements**:
  - **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.

### 3. **Request Validation**
- **Limitation**: `guard.invalid_input` now lists **only the first 100 validation issues**.
- **Performance**: `POST /callback/:connectorId` and `POST /account/callback/social/:connectorId` stop validating after **100 invalid fields** (error response unchanged).

### 4. **Sign-in Experience**
- **New Setting**: `Show SSO connector names and logos before email match` (under **Console > Sign-in experience > Advanced options**).
  - **Default**: On (current behavior).
  - **Off**: Shows connectors only after email domain matches.
- **iOS/Safari Fix**: Sign-in page no longer loads blank on **iOS < 16.4** and **Safari < 16.4**. Now compiled for **iOS 15+** and **Safari 15+**.

---

## 🐛 **Bug Fixes**

### 1. **Social Sign-in**
- **Unreachable Provider**: Returns `502 connector.social_provider_unreachable` (with network error and connector ID) instead of generic 500.
- **Declined Authorization**: Returns `401 connector.authorization_failed` with provider-specific `error` and `error_description` (e.g., `access_denied`, `user_cancelled_authorize`).
- **Error Messages**: Now shows the **actual provider error message** instead of `{}`.

### 2. **OAuth & OIDC**
- **Space-Padded Scopes**: Leading/trailing/repeated spaces in `scope` (e.g., `" offline_access"`) are now ignored. Empty scopes are treated as omitted.

### 3. **Management API**
- **`customClientMetadata`**: Rejects unknown keys with `400 guard.invalid_input` (lists the key in `data`).
- **Pagination Links**: Retains **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 >60 minutes** and updates docs to mention user IDs.

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

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

---

## 🔄 **Connectors**

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

### 2. **Patreon**
- **API v1 Removed**: Connector now uses **Patreon API v2** identity endpoint → **sign-in restored**.

### 3. **Connector Kit**
- **Performance**: `jsonGuard` and `jsonObjectGuard` now build schema **once** (not per nested value), speeding up validation 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**
- **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 and 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**
- **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**
- **Log**: Warns once if `/console` request reaches default tenant due to **mismatched origin**.
- **Action**: Check **Console URL** and `ADMIN_ENDPOINT` configuration.

---

## 🙌 **Contributors**
Huge thanks to the community for contributing to this release:

| Contributor | Contributions |
|-----------|--------------|
| [@nicolaj0](https://github.com/nicolaj0) | Webhook `deliveryId`, `hasPassword`, organization filter, `customClientMetadata` validation, social errors, DNS retries, connector 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 Key Actions for Users**
1. **Upgrade**: Run `logto db alteration deploy` after upgrading.
2. **SAML**: Update IdP audience to match SP Entity ID.
3. **Third-Party Apps**: Switch to **first-party apps** for Account API access.
4. **Node.js**: Ensure Node.js 26+ is used (if self-hosting).
5. **Check Logs**: Watch for `ADMIN_ENDPOINT` mismatch warnings.

---

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