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)** of the connector.
- **Impact**: 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 match the connector’s **SP Entity ID**.
- **Note**: This change was introduced after an upgrade.

### 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.
- **Third-Party Apps**: Now receive `403 auth.third_party_application_forbidden`.
- **First-Party Apps (e.g., Account Center, Console)**: Unaffected.

### 3. **Connector Request Errors**
- **Privacy Enhancement**: When a connector request fails (e.g., network timeout), **sensitive data** (request bodies, headers, query strings) is **no longer logged or exposed**.
- **Only**: Error name, code, message, and request method/URL are retained.
- **Purpose**: Improve security and reduce telemetry noise.

### 4. **Single-Use Codes and Tokens**
- **Behavior Change**: Authorization codes, device codes, pushed auth requests, and one-time tokens are now **accepted only once**.
- **Reused Token Response**:
  - `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**
- **Validation**: `GET` and `POST /api/saml/:id/authn` now reject malformed SAML XML (e.g., unescaped `&`, mismatched tags) with `400 application.saml.invalid_saml_request`.
- **Audit Log**: Format errors are recorded under `samlRequestError`.
- **Error Handling**: Requests that cannot be decoded/parsed now return `400` instead of `500` if signed requests are not required.

### 2. **Logto Tunnel (`@logto/tunnel` v0.3.12)**
- **Static File Serving**:
  - Symlinks are resolved; files outside the `--experience-path` return `404`.
  - `Range` headers with end past file size are clamped; unsatisfiable ranges return `416`.
- **Security**: Prevents directory traversal and improves robustness.

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

### 4. **Sign-in Experience**
- **iOS/Safari Compatibility**: Fixed blank sign-in page on **iOS < 16.4** 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`.
- **Error Messages**: Now show actual provider messages instead of `{}`.

### 6. **OAuth & OIDC**
- **Scope Handling**: Leading/trailing/repeated spaces in `scope` are now ignored.
- **Fix**: Prevents `invalid_scope` errors for clients like OpenAI Codex.

### 7. **Management API**
- **`customClientMetadata`**: Unknown keys now return `400 guard.invalid_input` with the key listed.
- **Pagination Links**: Repeated query parameters are preserved (not joined with commas).
- **One-Time Token Count**: `Total-Number` header now reflects filtered results.
- **Manual Unlock**: Clears active security verification lockouts >60 minutes.

### 8. **SAML Applications**
- **Attribute Mapping**: Fixed issue where mapped attributes (e.g., `o365role`) were sent as literal `{attr...}` instead of user values.

### 9. **Console & Account Center**
- **Application Access Control**: Organization selector now filters 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.

---

## 🔄 **Connectors**

### 1. **Standard OAuth 2.0 & OIDC**
- **Token Response Flexibility**:
  - `expires_in` as string (e.g., Criipto) is now accepted.
  - `scope` as JSON array (e.g., Twitch) is now accepted and normalized to space-delimited string.

### 2. **Patreon**
- **API v1 Deprecation**: Patreon removed v1 API.
- **Fix**: Now uses **v2 identity endpoint** for profile data.

### 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** 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 `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**:
  - Core now retries on DNS failures (`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 `/console` request reaches 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, 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**
- [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**

| Action | Description |
|------|-------------|
| 🔧 **SAML Setup** | Update IdP audience to match SP Entity ID if sign-in fails. |
| 🛠️ **API Access** | Ensure third-party apps use **first-party apps** for Account API. |
| 📦 **Upgrade** | Run `logto db alteration deploy` after upgrading. |
| 🔄 **Node.js** | Use Node.js 22, 24, or 26 (minimum versions required). |
| 🧩 **Connectors** | Verify Patreon and OAuth 2.0 connectors work as expected. |
| 🧪 **Testing** | Test sign-in on older iOS/Safari versions. |

---

This release focuses on **security hardening**, **improved error handling**, **better UX**, and **enhanced stability**. It also introduces **important breaking changes** (especially around SAML and third-party API access), so careful planning is required during upgrades.