The provided content is a **release notes document** for **Logto**, a developer-focused identity platform, detailing changes in version **v1.46.0**. It includes updates across multiple areas such as **security**, **connectors**, **APIs**, **bug fixes**, and **OSS (Open Source Software) improvements**.

Below is a **structured summary** of the key points, organized by category, to help you quickly understand what's new or changed:

---

### 🔐 **Security Hardening**
1. **SAML Assertion Audience**  
   - SAML assertions are now validated against the **SP Entity ID (Audience URI)**.
   - If a SAML sign-in fails with `"SAML assertion audience does not match the SP entity ID"`, update your **Identity Provider (IdP)** to use the correct **Audience URI** from the connector settings.

2. **Account API & Third-Party Apps**  
   - All Account API operations now require a **first-party application**.
   - Third-party apps receive `403 auth.third_party_application_forbidden` when trying to access restricted endpoints.
   - Affected endpoints:
     - Retrieving/refreshing SSO provider tokens (`GET`, `PUT` `/api/my-account/identities/...`)
     - Reading backup codes, sessions, grants, and trusted devices.

3. **Connector Request Errors**  
   - Sensitive data (request bodies, headers, query strings) are **no longer logged or exposed** in error responses.
   - Only error name, code, message, and URL method/path are retained for privacy and security.

4. **Single-Use Codes & Tokens**  
   - Authorization codes, device codes, pushed auth requests, and one-time tokens are now **single-use only**.
   - Reuse results in errors:
     - `invalid_grant` (authorization code)
     - `invalid_request_uri` (pushed auth request)
     - `one_time_token.token_consumed` (one-time token)
   - **Refresh tokens** still support reuse within their window.

5. **SAML Applications**  
   - Rejects malformed SAML XML with `400 application.saml.invalid_saml_request`.
   - Logs format errors under `samlRequestError` in audit logs.
   - Prevents 500 errors for unparseable requests when signed auth is not required.

---

### 🛠️ **Connectors & Integrations**
1. **Standard OAuth 2.0 & OIDC**  
   - Supports `expires_in` as a **string** (e.g., from Criipto).
   - Accepts `scope` as a **JSON array** (e.g., from Twitch), normalizing it to a space-separated string.

2. **Patreon Connector**  
   - Migrated from deprecated v1 API to **v2 identity endpoint**.
   - Fixes sign-in issues caused by `410 Gone` errors.

3. **Connector Kit**  
   - `jsonGuard` and `jsonObjectGuard` now build schema **once**, improving performance for large JSON payloads.

---

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

---

### 📦 **API & Management**
1. **Request Validation**  
   - `guard.invalid_input` now shows **only the first 100 validation issues**.
   - Validation stops after **100 invalid fields** in `POST /callback` and `POST /account/callback/social`.

2. **Management API**  
   - Rejects unknown keys in `customClientMetadata` with `400 guard.invalid_input`.
   - Pagination links preserve **all repeated query parameters** (e.g., `?types=SPA&types=Traditional`).
   - `GET /api/one-time-tokens` now returns **correct total count** based on filters.
   - **Manual unlock** now clears **security verification lockouts >60 minutes**.

3. **SAML Applications**  
   - Fixed attribute mapping: placeholders like `{attr.o365role}` now return actual values.

---

### 🖥️ **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 hidden during loading when branding is disabled.

---

### 📚 **Documentation**
- **Swift Integration Guide**: Fixed inconsistent client name in code examples (prevents `Cannot find 'client' in scope` in Xcode).

---

### 📱 **Sign-in Experience**
- **Older Safari/iOS**: Fixed blank sign-in page on iOS <16.4 and Safari <15.4.
  - Now compiled for **iOS 15+ and Safari 15+**.

---

### 🌐 **Social Sign-in**
1. **Unreachable Provider**  
   - Returns `502 connector.social_provider_unreachable` on transport failures (timeout, DNS, etc.).
   - Includes network error code and connector ID in response.

2. **Declined Authorization**  
   - Returns `401 connector.authorization_failed` with provider-specific `error` and `error_description`.
   - Covers cases like `access_denied`, `user_cancelled_authorize`, etc.

3. **Provider Error Messages**  
   - Now shows actual provider error messages instead of `{}`.

---

### 🔄 **OAuth & OIDC**
- **Space-Padded Scopes**  
  - Handles scopes like `" offline_access"` (leading space) by ignoring empty values.
  - Prevents `invalid_scope` errors and forces users to re-authenticate.

---

### 🧰 **Self-Hosting & OSS Notes**
1. **Review Before Upgrade**  
   - Check changes in:
     - OAuth 2.0 & Azure AD email sync
     - SAML audience validation
     - Third-party Account API access

2. **Node.js 26 Support**  
   - Official Docker image now uses **Node.js 26**.
   - Minimum versions: 22.23.4, 24.22.1, 26.12.1 (includes **October 2026 security fixes**).

3. **Database Migration Required**  
   - Schema changes include:
     - New columns for SAML static attributes
     - New sign-in experience and Account Center settings
   - Run:  
     ```bash
     npm run alteration deploy
     # or
     logto db alteration deploy
     ```

4. **Database Connection Retries**  
   - Retries on DNS failures (`ENOTFOUND`, `EAI_AGAIN`) at startup and CLI commands (`db seed`, `db alteration deploy`).

5. **Admin Endpoint Warning**  
   - Logs warning if `/console` request reaches default tenant with mismatched origin.
   - Check **Console URL** and `ADMIN_ENDPOINT` environment variable.

---

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

---

### ✅ **Action Items for Users**
1. **Upgrade Checklist**:
   - Run `npm run alteration deploy` after upgrading.
   - Update **Identity Provider (IdP)** audience to match **SP Entity ID**.
   - Ensure **first-party apps** are used for Account API calls.
   - Check **Node.js version** (22, 24, or 26).
   - Verify **database connection** and **admin endpoint** settings.

2. **For Developers**:
   - Update **Swift code examples** to use consistent client names.
   - Handle new error codes (`403`, `401`, `400`, `416`, etc.).
   - Test SAML and OAuth flows with malformed inputs.

---

This release focuses on **security**, **stability**, **privacy**, and **developer experience**, with notable improvements in **error handling**, **API access control**, and **compatibility**.