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**, **UI/UX**, and **infrastructure**.

Below is a **structured summary** of the key changes and updates, organized by category for clarity and ease of understanding:

---

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

### 1. **SAML Assertion Audience**
- **Change**: SAML assertions are now accepted **only if the `Audience` matches the connector’s `Audience URI (SP Entity ID)`**.
- **Impact**: After upgrading, if SAML sign-in fails with `"SAML assertion audience does not match the SP entity ID"`, update your **Identity Provider (IdP)** to set the audience to the **SP Entity ID** shown in the connector settings.
- **Note**: This is a **security enhancement** to prevent spoofing.

### 2. **Account API & Third-Party Applications**
- **Change**: All **Account API operations** (e.g., retrieving tokens, reading backup codes, sessions) now require a **first-party application**.
- **Impact**:
  - Third-party apps receive `403 auth.third_party_application_forbidden`.
  - First-party apps (like Account Center and Console) are unaffected.
- **Action Required**: If your integration retrieves stored provider tokens, **switch to a first-party app**.

### 3. **Connector Request Errors**
- **Change**: When an outbound connector request fails (e.g., timeout), **sensitive data (headers, body, query strings)** are **no longer logged or exposed**.
- **Now logged**:
  - Error name, code, message
  - Request method
  - Origin and pathname of the URL
- **Purpose**: Enhances **security and privacy** by reducing log exposure.

### 4. **Single-Use Codes and Tokens**
- **Change**: Authorization codes, device codes, pushed auth requests, and one-time tokens are now **accepted only once**.
- **Error on reuse**:
  - `invalid_grant` for authorization codes
  - `invalid_request_uri` for pushed auth requests
  - `one_time_token.token_consumed` for one-time tokens
- **Exception**: Refresh tokens still allow reuse within their window.

---

## 🧩 **Connectors & Authentication**

### 1. **SAML Applications**
- **Change**: Rejects malformed SAML XML (e.g., unescaped `&`, mismatched tags) with `400 application.saml.invalid_saml_request`.
- **Audit Log**: Records the format error under `samlRequestError`.
- **Improved error handling**: Returns 400 instead of 500 for parsing failures (unless signed requests are required).

### 2. **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), normalizing it to a space-separated string.
- **Fixes**: Prevents invalid response errors from non-standard providers.

### 3. **Patreon Connector**
- **Change**: Migrated from deprecated **v1 API** to **v2 identity endpoint**.
- **Result**: Patreon sign-in now works again.

### 4. **Connector Kit**
- **Performance**: `jsonGuard` and `jsonObjectGuard` now build recursive JSON schema **once**, improving performance for large payloads.
- **Result**: Faster validation with **no change in results**.

---

## 🖥️ **UI/UX & Sign-In Experience**

### 1. **Sign-In Experience**
- **Fix**: No longer loads blank on **older Safari and iOS (before 16.4)**.
- **Now compiled for**: iOS 15 and Safari 15+.

### 2. **Social Sign-In**
- **Improved error handling**:
  - **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 (`error`, `error_description`).
  - **Provider error messages**: Now show actual provider messages instead of `{}`.

### 3. **OAuth & OIDC**
- **Fix**: Trims leading/trailing spaces in `scope` values (e.g., `" offline_access"`).
- **Impact**: Prevents `invalid_scope` errors and avoids forced re-authentication.

---

## 🛠️ **Management API & Console**

### 1. **Management API**
- **`customClientMetadata`**: Rejects unknown keys with `400 guard.invalid_input` and lists them in the response.
- **Pagination links**: Now preserve **all repeated query parameters** (e.g., `?types=SPA&types=Traditional`) instead of joining them.
- **One-time token count**: `Total-Number` header now counts **only matching tokens** when filtered by `email` or `status`.
- **Manual unlock**: Clears **security verification lockouts >60 minutes** and updates docs to mention user IDs.

### 2. **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**: No longer shows "Powered by Logto" during loading when branding is hidden.

---

## 📚 **Documentation**
- **Swift integration guide**: Fixed **client name inconsistency** in code examples (previously caused `Cannot find 'client' in scope` in Xcode).
- **Fix**: Now uses consistent client name across examples.

---

## 🧰 **Self-Hosting & OSS Notes**

### 1. **Review Before Upgrading**
- **Key areas to 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 settings for **sign-in experience** and **Account Center**
- **Action**: Run `npm run alteration deploy` or `logto db alteration deploy` **before starting the new version**.
- **Reference**: [Upgrade Guide](https://docs.logto.io/logto-oss/upgrading-oss-version)

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

### 5. **Admin Endpoint Warning**
- **New warning**: Logs once when a `/console` request reaches the default tenant due to **mismatched admin endpoint**.
- **Action**: Check **Console URL** and `ADMIN_ENDPOINT` configuration.

---

## 🌟 **Contributors**
Huge thanks to the community for their contributions:

| Contributor | Contributions |
|-----------|---------------|
| [@nicolaj0](https://github.com/nicolaj0) | Webhook `deliveryId`, `hasPassword`, organization filter, `customClientMetadata` validation, social errors, DNS retries, connector request errors |
| [@RaphaelFakhri](https://github.com/RaphaelFakhri) | Repeated query parameters in pagination links (first contribution) |
| [@mvanhorn](https://github.com/mvanhorn) | `ADMIN_ENDPOINT` mismatch warning |
| [@timokoethe](https://github.com/timokoethe) | Consistent client name in Swift guide |

---

## 🔗 **Full Changelog**
- [Compare 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**
| Action | Description |
|------|-------------|
| 🔐 **SAML Users** | Update IdP audience to match SP Entity ID |
| 🧩 **Third-Party Apps** | Switch to first-party apps for Account API access |
| 🛠️ **Self-Hosted Users** | Run `logto db alteration deploy` after upgrade |
| 📦 **Node.js Users** | Ensure Node.js 26+ is used (minimum version: 26.12.1) |
| 🧪 **Developers** | Test OAuth/SAML integrations for compatibility |

---

This release focuses on **security**, **stability**, **compatibility**, and **user experience**, with significant improvements in error handling, logging, and performance. Be sure to review the **database migration** and **security policy changes** before upgrading.