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.
- **Why**: 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**: Error name, code, message, request method, and URL path.
- **Purpose**: Enhances security by reducing exposure of sensitive data in logs.

### 4. **Single-Use Codes and Tokens**
- **Change**: Authorization codes, device codes, pushed auth requests, and one-time tokens are now **accepted only once**.
- **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.

### 5. **SAML Applications**
- **Change**: Rejects malformed SAML XML (e.g., unescaped `&`, mismatched tags) with `400 application.saml.invalid_saml_request`.
- **Audit log**: Records the format error under `samlRequestError`.
- **Improvement**: Returns 400 instead of 500 for unparseable requests (unless signed auth is required).

---

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

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

### 2. **Request Validation**
- **Change**: `guard.invalid_input` now lists **only the first 100 validation issues**.
- **Endpoint**: `POST /callback/:connectorId` and `POST /account/callback/social/:connectorId` stop validating after 100 invalid fields.
- **Note**: Error response format remains unchanged.

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

### 4. **OAuth & OIDC**
- **Space-padded scopes**: Leading/trailing/repeated spaces in `scope` are now ignored.
  - Example: `" offline_access"` → treated as `offline_access`.
  - Empty scopes are ignored; refresh tokens keep original scope.
- **Fix**: Resolves sign-in issues with clients like OpenAI Codex.

### 5. **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 active security verification lockouts >60 minutes.

### 6. **SAML Applications**
- **Attribute placeholders**: Mapped attributes like `o365role` now return the **actual user value** instead of `{attr...}`.

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

### 8. **Documentation**
- **Swift integration guide**: Fixed `Cannot find 'client' in scope` by using consistent client name 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**
- **Fix**: Patreon v1 API deprecated → now uses **v2 identity endpoint**.
- **Result**: Patreon sign-in restored.

### 3. **Connector Kit**
- **Performance**: `jsonGuard` and `jsonObjectGuard` now build schema **once**, not per nested value.
- **Benefit**: Faster validation for large JSON payloads.

---

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

### 1. **Review Before Upgrading**
- **Key areas to check**:
  - OAuth 2.0 and 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**
- **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**
- **Improvement**: Retries on DNS failures (`ENOTFOUND`, `EAI_AGAIN`) at startup and CLI commands (`db seed`, `db alteration deploy`).
- **Benefit**: More resilient startup and setup.

### 5. **Admin Endpoint Warning**
- **New behavior**: Logs a warning once if a `/console` request reaches the default tenant due to **mismatched origin**.
- **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 provider 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**
| Action | Description |
|------|-------------|
| 🔧 **Upgrade** | Run `npm run alteration deploy` after upgrading. |
| 🔐 **SAML Fix** | Update IdP audience to match SP Entity ID. |
| 🛠️ **API Access** | Use first-party apps for Account API operations. |
| 🧪 **Testing** | Test SAML, OAuth, and social sign-in flows. |
| 📦 **Node.js** | Ensure Node.js 26+ is used in production. |

---

This release strengthens **security**, improves **error visibility**, and enhances **developer experience**. Be sure to review the **database migration** and **security changes** before upgrading.