The provided content is a **release notes document** for **Logto**, a developer-focused identity platform. It details changes, improvements, bug fixes, and security updates in a specific version (likely **v1.46.0**, based on the changelog link). Below is a **structured summary** of the key points, organized by category for clarity and ease of understanding.

---

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

### 1. **SAML Assertion Audience**
- **Change**: SAML assertions are now validated against the **Audience URI (SP Entity ID)** of the connector.
- **Impact**: If a SAML sign-in fails with `"SAML assertion audience does not match the SP entity ID"`, you must:
  - Set the **Audience** at your identity provider (IdP) to match the **SP Entity ID** in the Logto connector settings.
- **Note**: This change was introduced after an upgrade and affects SAML enterprise SSO connectors.

### 2. **Account API & Third-Party Applications**
- **New Requirement**: All Account API operations now require a **first-party application**.
- **Affected Endpoints**:
  - `GET /api/my-account/identities/:target/access-token`
  - `GET /api/my-account/sso-identities/:connectorId/access-token`
  - `PUT /api/my-account/identities/:target/access-token`
  - Reading backup codes, sessions, grants, and trusted devices.
- **Error for Third-Party Apps**: `403 auth.third_party_application_forbidden`
- **First-Party Apps (e.g., Account Center, Console)**: Unaffected.
- **Action Required**: If your integration retrieves stored provider tokens, switch to using a **first-party app**.

### 3. **Connector Request Errors**
- **Privacy Enhancement**: When a connector request fails (e.g., network timeout), the error is now **sanitized**:
  - Only the **error name, code, and message** are logged/exported.
  - **Request bodies, headers, and query strings are no longer included**.
- **Exception**: The server log still includes the **request method** and **URL origin/pathname**.

### 4. **Single-Use Codes and Tokens**
- **New Behavior**: One-time tokens (authorization codes, device codes, pushed auth requests, one-time tokens) are now **single-use only**.
- **Error on Reuse**:
  - `invalid_grant` for authorization codes
  - `invalid_request_uri` for pushed authorization requests
  - `one_time_token.token_consumed` for one-time tokens
- **Exception**: Refresh tokens still allow reuse within their window.

### 5. **SAML Applications**
- **Validation**: `GET` and `POST /api/saml/:id/authn` now reject malformed SAML XML (e.g., unescaped `&`, mismatched tags) with `400 application.saml.invalid_saml_request`.
- **Audit Log**: Format errors are recorded under `samlRequestError`.
- **Error Handling**: Requests that cannot be decoded/parsed now return `400` instead of `500` when signed authentication is not required.

---

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

### 1. **Connector Branding Before Email Match**
- **New Setting**: `Show SSO connector names and logos before email match`
- **Location**: `Console > Sign-in experience > Sign-up and sign-in > Advanced options`
- **Default**: On (keeps current behavior).
- **Use Case**: Turn off to show SSO connectors **only after** email domain matches.

### 2. **Logto Tunnel (v0.3.12)**
- **Security Improvements**:
  - **Symlinks**: Resolved before serving. Files outside the `--experience-path` return `404`.
  - **Range Headers**: If `Range` end exceeds file size, it’s clamped. Unsatisfiable ranges return `416`.
- **Note**: Symlinks pointing inside the path and symlinked experience paths still work.

### 3. **Request Validation**
- **Limit**: `guard.invalid_input` now lists **only the first 100 validation issues**.
- **Performance**: `POST /callback/:connectorId` and `POST /account/callback/social/:connectorId` stop validating after **100 invalid fields** (error response unchanged).

---

## 🐛 **Bug Fixes & Stability Improvements**

### 1. **Sign-in Experience**
- **Fix**: Sign-in page no longer loads blank on **older Safari/iOS (pre-16.4)**.
- **Reason**: Now compiled for **iOS 15 and Safari 15+**.

### 2. **Social Sign-in**
- **Unreachable Provider**: Now returns `502 connector.social_provider_unreachable` with network error code and connector ID. Users see a translated message.
- **Declined Authorization**: Now returns `401 connector.authorization_failed` with provider-specific `error` and `error_description` (e.g., `access_denied`, `user_cancelled_authorize`).
- **Provider Error Messages**: Now show actual provider messages instead of `{}`.

### 3. **OAuth & OIDC**
- **Space-Padded Scopes**: Leading/trailing/repeated spaces in `scope` (e.g., `" offline_access"`) are now ignored. Empty scopes are treated as omitted.

### 4. **Management API**
- **`customClientMetadata`**: Unknown keys now return `400 guard.invalid_input` with the key listed (previously silently ignored).
- **Pagination Links**: Repeated query parameters (e.g., `?types=SPA&types=Traditional`) are now preserved instead of being joined.
- **One-Time Token Count**: `Total-Number` header now counts **only matching tokens** when filtered by `email` or `status`.
- **Manual Unlock**: Clears active security verification lockouts **longer than 60 minutes**.

### 5. **SAML Applications**
- **Attribute Placeholders**: Mapped attributes (e.g., `o365role`) now return the **actual user value** instead of the literal `{attr...}` placeholder.

### 6. **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" no longer appears during loading when branding is hidden.

### 7. **Documentation**
- **Swift Integration Guide**: Fixed `Cannot find 'client' in scope` error by using consistent client names in code examples.

### 8. **Connectors**
- **Standard OAuth 2.0 & OIDC**:
  - Accepts `expires_in` as a **string** (e.g., from Criipto).
  - Accepts `scope` as a **JSON array** (e.g., from Twitch), normalized to space-delimited string.
- **Patreon**: Now uses **API v2 identity endpoint** (v1 deprecated), restoring sign-in functionality.
- **Connector Kit**: `jsonGuard` and `jsonObjectGuard` now build schema **once**, improving performance for large JSON payloads.

---

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

### 1. **Review Before Upgrading**
- **Key Areas to Check**:
  - OAuth 2.0 and 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 and new sign-in/Account Center settings.
- **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**: Core and CLI commands (e.g., `db seed`, `db alteration deploy`) now **retry** on:
  - DNS failures (`ENOTFOUND`, `EAI_AGAIN`)
  - Transient connection errors
- **Previously**: Would exit immediately.

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

---

## 🙌 **Contributors**
Special thanks to the community for their contributions:

| Contributor | Contributions |
|-----------|---------------|
| [@nicolaj0](https://github.com/nicolaj0) | Webhook `deliveryId`, `hasPassword`, organization filter, `customClientMetadata` validation, unreachable social errors, declined authorization 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 integration 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**
1. **Upgrade**: Ensure you run the **database migration** (`logto db alteration deploy`) after upgrading.
2. **SAML**: Update **Audience** at your IdP to match the **SP Entity ID**.
3. **Third-Party Apps**: Switch to **first-party apps** for Account API access.
4. **Node.js**: Upgrade to **Node.js 26** (or 22/24) for security and compatibility.
5. **Check Logs**: Watch for `ADMIN_ENDPOINT` mismatch warnings.
6. **Test**: Verify SAML, social sign-in, and OAuth flows post-upgrade.

---

This release focuses on **security hardening**, **privacy**, **stability**, and **developer experience**. It’s a significant update for self-hosted and OSS users, with important changes to SAML, API access, and error handling.