Skip to content

Commit 105f0f6

Browse files
docs: drop ferndef auth changes
Co-Authored-By: Devin Logan <devinannlogan@gmail.com>
1 parent c527c4a commit 105f0f6

1 file changed

Lines changed: 0 additions & 24 deletions

File tree

fern/products/api-def/ferndef/auth.mdx

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -131,30 +131,6 @@ client = new Client({
131131
})
132132
```
133133

134-
### Omit username or password
135-
136-
If your API only expects one half of a basic auth credential pair (for example, a token in the username and an empty password), set `omit: true` on the field you want to remove from the generated SDK:
137-
138-
```yaml title="api.yml" {8}
139-
auth: Basic
140-
auth-schemes:
141-
Basic:
142-
scheme: basic
143-
username:
144-
name: apiToken
145-
password:
146-
omit: true
147-
```
148-
149-
The omitted field is removed from the SDK's constructor entirely. Internally, an empty string is used to encode the `Authorization` header — omitting `password` produces `base64("apiToken:")`, and omitting `username` produces `base64(":password")`. If both fields are omitted, no `Authorization` header is sent.
150-
151-
```ts index.ts
152-
// Only the non-omitted field is exposed
153-
const client = new Client({
154-
apiToken: "ey34..."
155-
})
156-
```
157-
158134
## Custom header (e.g. API key)
159135

160136
You can also create your own authentication scheme with customized headers.

0 commit comments

Comments
 (0)