The provided content is a **release notes document** for **Logto**, a developer platform for authentication and identity management. 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**
- **Change**: SAML assertions are now accepted **only if the `Audience` matches the connector’s `Audience URI (SP Entity ID)`**.
- **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.
- **Purpose**: Enhances security by ensuring SAML assertions are intended for the correct service provider.

---

### 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.
- **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 retrieves stored provider tokens, switch to a **first-party app**.

---

### 3. **Connector Request Errors**
- **Privacy & Security**: When a connector request fails (e.g., network timeout), **sensitive data (headers, body, query strings)** is no longer logged or exposed.
- **Only the following are logged**:
  - Error name, code, and message
  - Request method
  - Origin and pathname of the URL
- **Purpose**: Reduces risk of exposing sensitive data in logs or telemetry.

---

### 4. **Single-Use Codes and Tokens**
- **Behavior Change**: Authorization codes, device codes, pushed authorization requests, and one-time tokens are now **accepted only once**.
- **Reused Token Errors**:
  - `invalid_grant` for authorization codes
  - `invalid_request_uri` for pushed authorization requests
  - `one_time_token.token_consumed` for one-time tokens
- **Exception**: Refresh tokens still allow reuse within their window.

---

### 5. **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 or parsed now return `400` instead of `500` (unless signed authentication is required).

---

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

---

### 7. **Request Validation**
- **Limits**:
  - `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.

---

## 🐞 **Bug Fixes & Stability**

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

---

### 2. **Social Sign-in**
- **Unreachable Provider**: Now returns `502 connector.social_provider_unreachable` with network error code 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`).
- **Provider Errors**: Now show the **actual error message** from the provider (not `{}`).

---

### 3. **OAuth & OIDC**
- **Space-Padded Scopes**: Leading/trailing spaces in `scope` (e.g., `" offline_access"`) are now ignored.
- **Fix**: Prevents `invalid_scope` errors and avoids forced re-authentication.

---

### 4. **Management API**
- **`customClientMetadata`**: Unknown keys now return `400 guard.invalid_input` with the key listed (previously silently ignored).
- **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.

---

### 5. **SAML Applications**
- **Attribute Placeholders**: Mapped attributes (e.g., `o365role`) now return the **actual user value** instead of the literal `{attr...}` placeholder.

---

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

---

### 7. **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**, restoring sign-in functionality.

### 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**
- Check:
  - 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 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**
- **Improved Resilience**: Retries on DNS failures (`ENOTFOUND`, `EAI_AGAIN`) at startup and during CLI commands (`db seed`, `db alteration deploy`).

### 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**
- [v1.45.0 → v1.46.0](https://github.com/logto-io/logto/compare/v1.45.0...v1.46.0)

---

## ✅ **Summary of Critical Actions**
1. **Update Identity Provider Audience** if SAML sign-in fails.
2. **Switch to first-party apps** for Account API access.
3. **Run database migration** (`logto db alteration deploy`) after upgrading.
4. **Check `ADMIN_ENDPOINT`** if seeing console warnings.
5. **Review OAuth/SAML configurations** for compatibility.

---

This release focuses on **security hardening**, **stability improvements**, and **better error handling**, with notable changes in **SAML**, **Account API**, and **third-party app restrictions**. Self-hosted users should pay special attention to **database migrations** and **Node.js version requirements**.