Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions fern/products/api-def/openapi/auth.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ auth-schemes:
env: MY_CLIENT_SECRET
```

[Set `omit: true` on `username` or `password`](/learn/sdks/reference/generators-yml#usernameomit-passwordomit) to remove it from the generated SDK.

</Accordion>
<Accordion title="API key">

Expand Down
3 changes: 3 additions & 0 deletions fern/products/sdks/snippets/basic-auth-params.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,7 @@ auth-schemes:
</ParamField>
<ParamField path="username.env, password.env" type="string" required={false}>
Environment variable name that the SDK will automatically scan for the username or password value. When this environment variable is present, users don't need to explicitly provide the username parameter. Follow naming conventions like `YOUR_APP_USERNAME` or `SERVICE_CLIENT_ID`.
</ParamField>
<ParamField path="username.omit, password.omit" type="boolean" default="false" toc={true}>
Use when your API expects only one half of the basic auth credential pair. When `true`, the field is removed from the generated SDK's public API. The omitted field is treated as an empty string when encoding the `Authorization` header (omitting `password` produces `base64("username:")`; omitting `username` produces `base64(":password")`). When both are omitted, the `Authorization` header is skipped entirely.
</ParamField>
Loading