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/...`)
     - Reading backup codes, sessions, grants, trusted devices
   - **Solution**: Use a first-party app (e.g., Account Center, Console) for these operations.

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.
   - Improves security and reduces log clutter.

4. **Single-Use Codes and 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)
   - **Note**: Refresh tokens still support reuse within their window.

5. **SAML Applications**  
   - Rejects malformed SAML XML (e.g., unescaped `&`, mismatched tags) with `400 application.saml.invalid_saml_request`.
   - Logs format errors in audit logs under `samlRequestError`.
   - 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 JSON schema **once**, improving performance for large 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**.
- Improves security and correctness when serving static assets.

---

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

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

3. **SAML Applications**  
   - Fixed attribute placeholders (e.g., `{attr.o365role}`) now return actual user 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**: Removes "Powered by Logto" during loading when branding is hidden.

---

### 📚 **Documentation**
- **Swift Integration Guide**: Fixed inconsistent client name in code examples (previously caused `Cannot find 'client' in scope` in Xcode).
  - Fix: [PR #9788](https://github.com/logto-io/logto/pull/9788)

---

### 🐞 **Bug Fixes & Stability**
1. **Sign-in Experience**  
   - Fixed blank sign-in page on **older Safari/iOS (pre-16.4)** by compiling for iOS 15/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.
   - **Provider Error Messages**: Now show actual provider messages instead of `{}`.

3. **OAuth & OIDC**  
   - **Space-padded scopes** (e.g., `" offline_access"`) are now ignored; empty scopes are treated as omitted.

---

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

2. **Node.js 26 Support**  
   - Official Docker image now uses **Node.js 26**.
   - Supported versions: **22, 24, 26** (minimums: 22.23.4, 24.22.1, 26.12.1).

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
     ```
   - [Upgrade Guide](https://docs.logto.io/logto-oss/upgrading-oss-version)

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 due to mismatched `ADMIN_ENDPOINT`.
   - Check Console URL and `ADMIN_ENDPOINT` environment variable.

---

### 👥 **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 integration 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**
1. **Upgrade Checklist**:
   - Run database migration (`npm run alteration deploy`)
   - Update `ADMIN_ENDPOINT` if needed
   - Ensure third-party apps use **first-party apps** for Account API access
   - Update SAML IdP audience to match SP Entity ID
   - Test SAML, social, and OAuth flows

2. **Security Best Practices**:
   - Use first-party apps for sensitive operations
   - Monitor audit logs for SAML or connector errors
   - Validate connector configurations post-upgrade

---

This release focuses on **security hardening**, **stability**, **performance**, and **developer experience**. It’s a significant update for both **self-hosted** and **cloud users**.

Let me know if you'd like a **cheat sheet**, **upgrade checklist**, or **migration guide**!