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.

---

## 🔐 **Security Hardening & Policy Changes**

### 1. **SAML Assertion Audience**
- **Change**: SAML assertions are now validated against the **Audience URI (SP Entity ID)** of the connector.
- **Error**: `SAML assertion audience does not match the SP entity ID`
- **Fix**: Ensure your identity provider's **Audience** matches the **SP Entity ID** 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, trusted devices
- **Third-Party Apps**: Now receive `403 auth.third_party_application_forbidden`
- **First-Party Apps (e.g., Account Center, Console)**: Unaffected.

> ✅ **Action**: If your integration uses third-party apps to retrieve tokens, switch to a **first-party app**.

---

## 🛠️ **New Features & Enhancements**

### 1. **SSO Connector Visibility**
- **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 match.

### 2. **Connector Request Errors (Privacy)**
- **Change**: Request bodies, headers, and query strings are **no longer logged or exposed** in error responses.
- **Retained**: Error name, code, message, request method, and URL path.
- **Purpose**: Improve security and reduce log noise.

### 3. **Single-Use Codes & Tokens**
- **Change**: One-time tokens (authorization, device, pushed, one-time) are now **single-use only**.
- **Error on Reuse**:
  - `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.

### 4. **SAML Application Improvements**
- **Validation**: Rejects malformed XML (e.g., unescaped `&`, mismatched tags) with `400 application.saml.invalid_saml_request`.
- **Audit Log**: Records format errors under `samlRequestError`.
- **Error Handling**: Returns 400 instead of 500 for unparseable requests (if not signed).

### 5. **Logto Tunnel (v0.3.12)**
- **Static File Serving**:
  - Symlinks are resolved; files outside `--experience-path` return 404.
  - `Range` headers with end past file size are clamped; unsatisfiable ranges return 416.
- **Security**: Prevents directory traversal and ensures correct range handling.

### 6. **Request Validation**
- **Limit**: Only the **first 100 validation issues** are returned in `guard.invalid_input` errors.
- **Performance**: Stops validating after 100 invalid fields in `POST /callback/*` and `POST /account/callback/social/*`.

---

## 🐞 **Bug Fixes & Stability**

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

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

### 3. **OAuth & OIDC**
- **Scope Handling**: Trims leading/trailing/repeated spaces in `scope` values.
  - Example: `" offline_access"` → `offline_access`
  - Empty scopes are ignored; refresh tokens keep original scope.

### 4. **Management API**
- **`customClientMetadata`**: Rejects unknown keys with `400 guard.invalid_input` and lists them.
- **Pagination Links**: Preserves all repeated query parameters (e.g., `?types=SPA&types=Traditional`).
- **One-Time Token Count**: `Total-Number` header now reflects filtered results.
- **Manual Unlock**: Clears security verification lockouts >60 minutes.

### 5. **SAML Applications**
- **Attribute Mapping**: Fixes placeholder `{attr...}` being sent instead of actual values.

### 6. **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**: Hides "Powered by Logto" during load when branding is hidden.

### 7. **Documentation**
- **Swift Guide**: Fixed `Cannot find 'client' in scope` by using consistent client name.

---

## 🔄 **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 **v2 identity endpoint**.
- **Result**: Patreon sign-in restored.

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

---

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

### 1. **Review Before Upgrade**
- 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
  - New sign-in experience and Account Center settings
- **Action**: Run `npm run alteration deploy` or `logto db alteration deploy` **before** starting the new version.

### 4. **Database Connection Retries**
- **Improved Resilience**:
  - Retries on DNS failure (`ENOTFOUND`, `EAI_AGAIN`) at startup.
  - CLI commands (`db seed`, `db alteration deploy`) now retry transient errors.

### 5. **Admin Endpoint Warning**
- **New Log**: Warns once if `/console` request reaches default tenant with mismatched origin.
- **Fix**: Check Console URL and `ADMIN_ENDPOINT`.

---

## 🙌 **Contributors**
Special thanks to:
- **@nicolaj0** – Multiple contributions (webhooks, metadata validation, error handling, DNS retries)
- **@RaphaelFakhri** – First contribution: pagination links
- **@mvanhorn** – `ADMIN_ENDPOINT` warning
- **@timokoethe** – Swift guide consistency

🔗 **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**

| Task | Action |
|------|--------|
| **Upgrade** | Run `logto db alteration deploy` after upgrading |
| **SAML Issues** | Ensure **Audience URI** matches identity provider |
| **Third-Party Apps** | Switch to **first-party apps** for Account API access |
| **Node.js** | Use **Node.js 26** or later for new deployments |
| **Security** | Review **SAML**, **OAuth**, and **API access** policies |
| **Debugging** | Check logs for `ENOTFOUND`, `EAI_AGAIN`, or `ADMIN_ENDPOINT` warnings |

---

This release focuses on **security hardening**, **privacy improvements**, **stability**, and **developer experience**. It’s especially important for **self-hosted deployments** due to the **database migration** and **Node.js upgrade**.