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**: A SAML assertion is now accepted **only if its `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**: Prevents spoofing and ensures assertions are intended for the correct service.

### 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
- **Error for third-party apps**: `403 auth.third_party_application_forbidden`
- **Note**: First-party apps (e.g., Account Center, Console) are unaffected.
- **Action**: If your integration uses stored provider tokens, switch to a **first-party app**.

### 3. **Connector Request Errors**
- **Change**: When an outbound connector request fails (e.g., timeout), **sensitive data (headers, body, query strings)** is no longer logged or exposed.
- **Only logged**: Request method, origin, pathname, error name/code/message.
- **Purpose**: Enhances security and privacy by reducing log exposure.

### 4. **Single-Use Codes and Tokens**
- **Change**: Authorization codes, device codes, pushed auth requests, and one-time tokens are now **single-use only**.
- **Reused token behavior**:
  - `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 & Improvements**

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

### 2. **SAML Applications**
- **Improved validation**:
  - Rejects malformed XML (e.g., unescaped `&`, mismatched tags) with `400 application.saml.invalid_saml_request`.
  - Logs format errors in audit log under `samlRequestError`.
  - Returns 400 instead of 500 for unparseable requests (if not signed).

### 3. **Logto Tunnel (`@logto/tunnel` v0.3.12)**
- **Security hardening**:
  - **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 ensures safe static file serving.

### 4. **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**: 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)**.
- **Fix**: Now compiled for **iOS 15 and Safari 15+**.

### 2. **Social Sign-in**
- **Unreachable provider**:
  - Returns `502 connector.social_provider_unreachable` instead of generic 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**:
  - Clients like OpenAI Codex send scopes with leading spaces (e.g., `" offline_access"`).
  - Logto now **ignores empty scopes** caused by spaces.
  - A scope of only spaces is treated as **omitted**, preserving original scope.

### 4. **Management API**
- **`customClientMetadata`**:
  - Rejects unknown keys with `400 guard.invalid_input`, listing the key.
  - Prevents typos (e.g., `refreshTokenTtlInDay`) from being silently ignored.
- **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 **active security verification lockouts longer than 60 minutes**.
  - Documentation now mentions **user IDs** and **security verification lockouts**.

### 5. **SAML Applications**
- **Attribute placeholders**:
  - Fixed: Mapped attributes like `o365role` now return **actual user values** instead of `{attr...}`.

### 6. **Console & Account Center**
- **Application access control**:
  - Organization selector now **filters results** when searching.
- **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 now 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., Criipto).
  - Accepts `scope` as a **JSON array** (e.g., Twitch), normalizing to space-delimited string.

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

### 3. **Connector Kit**
- **Performance**:
  - `jsonGuard` and `jsonObjectGuard` now build **recursive schema once**, not per nested value.
  - **Result**: 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**
- **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**
- **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**
- **At startup**: Retries on DNS failures (`ENOTFOUND`, `EAI_AGAIN`) instead of exiting.
- **CLI commands** (`db seed`, `db alteration deploy`): Now retry transient errors, including DNS failures.

### 5. **Admin Endpoint Warning**
- **New warning**: Logs once when a `/console` request reaches the 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 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. **Check logs**: Watch for `ADMIN_ENDPOINT` mismatch warnings.
5. **Test**: Verify SAML, social sign-in, and OAuth flows post-upgrade.

---

This release strengthens **security**, improves **error visibility**, and enhances **developer experience** — making Logto more robust and easier to use.