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**: A SAML assertion is now accepted **only if its `Audience` matches the connector’s `Audience URI (SP Entity ID)`** on the receiving domain or tenant’s default domain.
- **Impact**: After upgrading, if SAML sign-in fails with `"SAML assertion audience does not match the SP entity ID"`, update your **Identity Provider (IdP)** to set the audience to the **SP Entity ID** shown in the connector settings.

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

### 3. **Connector Request Errors**
- **Privacy Enhancement**: When a connector request fails (e.g., timeout), **sensitive data (headers, body, query strings)** are **no longer logged or exposed**.
- **Only the error name, code, and message** are recorded.
- **Request method and URL** are still logged for debugging.

### 4. **Single-Use Codes and Tokens**
- **Single Use Only**: Authorization codes, device codes, pushed auth requests, and one-time tokens are now **accepted only once**.
- **Reused tokens** return:
  - `invalid_grant` (authorization code)
  - `invalid_request_uri` (pushed auth request)
  - `one_time_token.token_consumed` (one-time token)
- **Exception**: Refresh tokens still allow reuse within their window.

---

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

### 1. **SAML Applications**
- **Strict XML Validation**: `GET` and `POST /api/saml/:id/authn` now reject malformed XML (e.g., unescaped `&`, mismatched tags) with `400 application.saml.invalid_saml_request`.
- **Audit Log**: Format errors are logged under `samlRequestError`.
- **Improved Error Handling**: 400 errors are returned instead of 500 for unparseable requests (unless signed auth is required).

### 2. **Logto Tunnel (`@logto/tunnel` v0.3.12)**
- **Security Hardening**:
  - **Symlinks**: Resolved before serving. Files outside `--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**
- **Limitations**:
  - `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**: The error response format remains unchanged.

### 4. **Sign-in Experience**
- **Safari/iOS Compatibility**: Fixed blank sign-in page on **iOS and Safari < 16.4**.
- **Fix**: Now compiled for **iOS 15 and Safari 15+**.

### 5. **Social Sign-in**
- **Unreachable Provider**: Returns `502 connector.social_provider_unreachable` with network error code and connector ID.
- **Declined Authorization**: Returns `401 connector.authorization_failed` with provider-specific `error` and `error_description`.
- **Provider Errors**: Now show actual error messages instead of `{}`.

### 6. **OAuth & OIDC**
- **Space-Padded Scopes**: Leading/trailing/repeated spaces in `scope` are now ignored.
  - Example: `" offline_access"` → treated as `offline_access`.
  - A scope with only spaces is treated as **omitted**.

### 7. **Management API**
- **`customClientMetadata`**: Unknown keys now return `400 guard.invalid_input` with the key listed.
- **Pagination Links**: Repeated query parameters (e.g., `?types=SPA&types=Traditional`) are preserved instead of being joined.
- **One-Time Token Count**: `Total-Number` header now reflects only **filtered tokens**.
- **Manual Unlock**: Clears **security verification lockouts >60 minutes** and now mentions user IDs.

### 8. **SAML Applications**
- **Attribute Placeholders**: Fixed issue where mapped attributes like `o365role` were sent as `{attr…}` instead of the actual value.

### 9. **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**: "Powered by Logto" no longer appears during loading when branding is hidden.

### 10. **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 Array `scope`**: Now accepted (e.g., from Twitch), normalized to space-delimited string.

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

### 3. **Connector Kit**
- **Performance**: `jsonGuard` and `jsonObjectGuard` now build schema **once**, improving performance for large JSON payloads.

---

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

### 1. **Review Before Upgrading**
- **Key Areas**:
  - 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).
- **Security**: Includes **October 2026 security fixes**.

### 3. **Database Migration Required**
- **Schema Changes**:
  - 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**
- **Improved Resilience**:
  - Retries on `ENOTFOUND`/`EAI_AGAIN` at startup.
  - CLI commands (`db seed`, `db alteration deploy`) now retry transient errors (including DNS).

### 5. **Admin Endpoint Warning**
- **New Log**: Warns 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 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 Critical Actions for Users**
1. **SAML Users**: Update IdP audience to match SP Entity ID.
2. **Third-Party App Developers**: Switch to **first-party apps** for Account API access.
3. **Self-Hosted Users**:
   - Run `logto db alteration deploy` after upgrade.
   - Ensure `ADMIN_ENDPOINT` matches Console URL.
   - Upgrade to **Node.js 26** (or 22/24) for security.
4. **Developers**:
   - Check Swift integration guide for consistent client names.
   - Handle `403`, `401`, `400` errors appropriately in apps.

---

This release focuses on **security**, **privacy**, **stability**, and **developer experience**. Be sure to review the **upgrade guide** and test in staging before deploying.