From ef68f7a13eb8c74e58e977f6a2319e61d21fac6a Mon Sep 17 00:00:00 2001 From: Devin Logan Date: Thu, 4 Sep 2025 08:45:44 -0400 Subject: [PATCH] add info on how to override auth scheme in generators.yml --- fern/products/api-def/openapi-pages/auth.mdx | 45 +++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/fern/products/api-def/openapi-pages/auth.mdx b/fern/products/api-def/openapi-pages/auth.mdx index 69d9f8990..3b969fa5b 100644 --- a/fern/products/api-def/openapi-pages/auth.mdx +++ b/fern/products/api-def/openapi-pages/auth.mdx @@ -193,4 +193,47 @@ components: type: apiKey in: header name: X_API_KEY -``` \ No newline at end of file +``` + +## Override security scheme + +You can use `generators.yml` to define custom authentication schemes that will take precedence when generating SDKs. + +First, use the `auth-schemes` property to define your authentication scheme. Then, specify your auth scheme in the `api` property to override your OpenAPI spec. + +```yml title="generators.yml" {1-6, 8} +auth-schemes: # Define custom auth scheme + Bearer: + scheme: bearer + token: + name: apiKey # Custom parameter name in the SDK + env: YOUR_TOKEN_NAME # Environment variable to auto-scan +api: + auth: Bearer # Apply the custom scheme, overriding the OpenAPI spec +``` + +### Auth scheme reference + + + + + + + + + + + + + + +#### get-token + + + +#### refresh-token + + + + +