> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://buildwithfern.com/learn/llms.txt.

## 0.42.0

**`(feat):`** 在生成的客户端中接入 OAuth 客户端凭证认证。当定义了 OAuth 客户端凭证方案时，生成的 `ClientConfig` 现在会携带解析后的令牌端点，且 `HttpClient` 在发起认证请求前会自动获取、缓存并刷新 bearer 令牌。此前 OAuth 脚手架虽然存在，但从未接入请求流程。

令牌交换现在遵循令牌端点所配置的请求/响应属性映射，而不再使用硬编码的 `client_id`/`client_secret`/`grant_type` 结构：请求体根据配置的属性名（例如 camelCase 的 `clientId`/`clientSecret`）构建，诸如 `grant_type` 之类的字面量属性仅在契约声明它们时才发送，访问令牌和过期时间也从配置的响应属性名中读取。