The provided text is a **release notes document** for **Logto**, a developer-focused identity platform. It details changes, improvements, bug fixes, and important considerations for **version 1.46.0** of the Logto platform.

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

---

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

1. **SAML Assertion Audience**
   - **Change**: SAML assertions are now only accepted if the `Audience` matches the **SP Entity ID (Audience URI)** of the connector.
   - **Impact**: After upgrading, if SAML sign-in fails with `"SAML assertion audience does not match the SP entity ID"`, you must **update your identity provider (IdP)** to set the audience to the correct **SP Entity ID**.
   - **Note**: This is a **breaking change** for SAML connectors.

2. **Account API & Third-Party Apps**
   - **Change**: All Account API operations (e.g., retrieving tokens, reading backup codes, sessions) now **require a first-party application**.
   - **Impact**: Third-party apps will now receive `403 auth.third_party_application_forbidden` when trying to access these endpoints.
   - **Solution**: Use a **first-party app** (like Account Center or Console) to access these APIs.

3. **Connector Request Errors**
   - **Change**: When a connector request fails (e.g., network timeout), **sensitive data (headers, body, query strings)** are no longer logged or exposed.
   - **Impact**: Improved security and privacy in logs and telemetry.
   - **Note**: The request method and URL are still logged for debugging.

4. **Single-Use Codes & Tokens**
   - **Change**: Authorization codes, device codes, pushed auth requests, and one-time tokens are now **single-use only**.
   - **Error**: Reuse results in `invalid_grant`, `invalid_request_uri`, or `one_time_token.token_consumed`.
   - **Exception**: Refresh tokens still allow reuse within their window.

5. **SAML Request Validation**
   - **Change**: Malformed SAML XML (e.g., unescaped `&`, mismatched tags) now returns `400 application.saml.invalid_saml_request` instead of a 500 error.
   - **Impact**: Better error handling and audit logging for malformed requests.

---

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

1. **SSO Connector Visibility**
   - **New Setting**: `Show SSO connector names and logos before email match` (under **Console > Sign-in experience > Advanced options**).
   - **Default**: On (current behavior).
   - **Use Case**: Turn off to show SSO connectors only after email domain matching.

2. **Logto Tunnel (v0.3.12)**
   - **Security**: Symlinks are resolved; files outside `--experience-path` return 404.
   - **Range Headers**: `Range` requests that exceed file size are clamped; unsatisfiable ranges return 416.

3. **Request Validation**
   - **Limit**: Only the **first 100 validation issues** are returned in `guard.invalid_input` errors.
   - **Performance**: Validation stops after 100 invalid fields in `POST /callback`.

4. **OAuth & OIDC**
   - **Scope Handling**: Leading/trailing spaces in `scope` are now ignored. A scope with only spaces is treated as omitted.

5. **Management API**
   - **Custom Metadata**: Unknown keys in `customClientMetadata` now return `400 guard.invalid_input`.
   - **Pagination**: Repeated query parameters (e.g., `?types=SPA&types=Traditional`) are preserved in pagination links.
   - **One-Time Tokens**: `Total-Number` header now reflects filtered results.
   - **Manual Unlock**: Clears long-term security verification lockouts (>60 mins).

6. **SAML Applications**
   - **Attribute Mapping**: Placeholder values like `{attr.o365role}` now return the actual user value.

7. **Console & Account Center**
   - **Application Access**: Organization selector now filters during search.
   - **Role Permissions**: Full API resource names shown; truncated names have tooltips.
   - **Branding**: "Powered by Logto" is hidden during loading when branding is disabled.

8. **Documentation**
   - **Swift Guide**: Fixed `Cannot find 'client' in scope` by using consistent client names.

---

### 🧩 **Connectors**

1. **Standard OAuth 2.0 & OIDC**
   - **Improved Compatibility**:
     - Accepts `expires_in` as a string (e.g., from Criipto).
     - Accepts `scope` as a JSON array (e.g., from Twitch), normalized to space-separated string.

2. **Patreon**
   - **Fix**: Replaced deprecated v1 API with v2 identity endpoint. Patreon sign-in now works again.

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

---

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

1. **Review Before Upgrading**
   - Check **SAML audience**, **OAuth 2.0**, and **Azure AD email sync** changes.

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 security fixes).

3. **Database Migration Required**
   - **Schema changes** include new columns for SAML attributes and sign-in 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 failures (`ENOTFOUND`, `EAI_AGAIN`) at startup and during CLI commands (`db seed`, `db alteration deploy`).

5. **Admin Endpoint Warning**
   - Logs a warning if a `/console` request reaches the default tenant due to mismatched `ADMIN_ENDPOINT`.
   - **Action**: Verify Console URL and `ADMIN_ENDPOINT` configuration.

---

### 🙌 **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 integration 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 database migration (`npm run alteration deploy`).
   - Update SAML IdP audience to match SP Entity ID.
   - Ensure third-party apps use first-party apps for Account API.
   - Verify `ADMIN_ENDPOINT` and Console URL.
2. **Test**:
   - SAML sign-in.
   - Social sign-in (especially for providers like Patreon).
   - OAuth token refresh with space-padded scopes.
3. **Review**:
   - SSO connector visibility settings.
   - Account Center branding.

---

This release focuses on **security**, **stability**, and **developer experience**, with notable improvements in error handling, API security, and compatibility. Be sure to **review the migration steps** before upgrading.