The provided content is a **release notes document** for **Logto**, a developer 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 **Audience URI (SP Entity ID)**.
   - 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/...`)
     - Reading backup codes, sessions, grants, 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.

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

5. **SAML Applications**  
   - Rejects malformed SAML XML with `400 application.saml.invalid_saml_request`.
   - Logs format errors in audit logs under `samlRequestError`.
   - Prevents 500 errors for unparseable requests (unless signed auth is 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 space-separated string.

2. **Patreon Connector**  
   - V1 API deprecated → now uses **Patreon API v2** identity endpoint.
   - Fixes sign-in issues caused by `410 Gone`.

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-Number` count based on filters.
   - Manual unlock clears **security verification lockouts >60 minutes**.

3. **SAML Applications**  
   - Fixed attribute placeholders (e.g., `{attr.o365role}`) now return actual user values.

---

### 🖼️ **Console & Account Center**
- **Sign-in Experience**:
  - Fixed blank sign-in page on **older Safari/iOS (pre-16.4)**.
  - Now compiled for **iOS 15+ and Safari 15+**.
- **Social Sign-in**:
  - Network errors (timeout, DNS, etc.) return **502 connector.social_provider_unreachable**.
  - Declined authorization returns **401 connector.authorization_failed** with provider-specific error.
  - Provider error messages now show actual error text instead of `{}`.
- **OAuth & OIDC**:
  - Handles **space-padded scopes** (e.g., `" offline_access"`) by trimming whitespace.
- **Console & Account Center**:
  - Application access control: **filters organizations** during search.
  - Role permissions: **full API resource names**, tooltips for truncated names.
  - Account Center: **removes "Powered by Logto"** during load when branding is hidden.

---

### 📚 **Documentation**
- **Swift Integration Guide**:
  - Fixed **client name inconsistency** in code examples (previously caused `Cannot find 'client' in scope`).
  - Thanks to [@timokoethe](https://github.com/timokoethe).

---

### 🧩 **Self-Hosting & OSS Notes**
1. **Upgrade Checklist**:
   - Review **OAuth 2.0**, **Azure AD email sync**, **SAML audience**, and **third-party API changes**.
2. **Node.js 26 Support**:
   - Official Docker image now runs on **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 settings for **sign-in experience** and **Account Center**
   - 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`.

---

### 👥 **Contributors**
Huge thanks to:
- **@nicolaj0** – Multiple contributions (webhooks, user metadata, error handling, DNS retries, etc.)
- **@RaphaelFakhri** – First contribution: pagination links
- **@mvanhorn** – `ADMIN_ENDPOINT` mismatch 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)

---

### ✅ **Action Items for Users**
| Task | Description |
|------|-------------|
| 🔁 **Upgrade** | Ensure you run `npm run alteration deploy` after upgrading. |
| 🔐 **Security** | Update SAML audience settings and switch to first-party apps for Account API. |
| 🛠️ **Debugging** | Check logs for `403 auth.third_party_application_forbidden` or `400 application.saml.invalid_saml_request`. |
| 🧪 **Testing** | Test SAML, social sign-in, and OAuth flows after upgrade. |

---

Let me know if you'd like a **cheat sheet**, **upgrade checklist**, or **summary for developers**!