⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

@thesandlord
Copy link
Contributor

docs: add authentication page for self-hosted documentation

Summary

Adds a new "Authentication" page under the Self-hosted docs section, covering two auth modes introduced in fern-platform#6928:

  1. Password authentication — Dockerfile example with FERN_AUTH_TYPE="password" and FERN_AUTH_SECRET.
  2. Basic token verification — JWT-based auth with env var reference table, a step-by-step flow explanation, a full Node.js (Express) example server that signs a JWT and redirects to the callback, and instructions for using the built-in /__test-login test endpoint.

The page is inserted in the sidebar between "Set up" and "Health check endpoints" at slug /learn/docs/self-hosted/authentication.

Review & Testing Checklist for Human

  • Verify env var names and JWT claims match the implementation — The doc references FERN_AUTH_TYPE, FERN_AUTH_SECRET, FERN_AUTH_ISSUER, FERN_AUTH_REDIRECT, FERN_AUTH_TEST_LOGIN, and JWT claims fern, iss, iat, exp. Confirm these match the actual code merged in fern-platform#6928.
  • Verify callback URL and query param names — The doc says the callback is at /api/fern-docs/auth/jwt/callback with fern_token and state query params. The state param name may actually depend on FERN_AUTH_RETURN_TO_QUERY_PARAM (defaulting to state) — decide if that nuance should be documented.
  • Check rendered page on preview deployment — Confirm MDX renders correctly (code blocks, tables, <Warning> callouts, <Markdown> snippet inclusion).
  • Review the example JS server for correctness — The JWT minting logic mirrors mintTestFernJWT from cache-proxy.js but is a standalone example. Verify it would actually produce a valid token accepted by the container.

Notes

Link to Devin run: https://app.devin.ai/sessions/13d0733d42bc4f8bacb714ee8a466a56
Requested by: @thesandlord

Co-Authored-By: Sandeep Dinesh <sandeep@buildwithfern.com>
@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring


Replace `<YOUR PASSWORD>` with the password users will enter to access the docs.

When a user visits the documentation, they are redirected to a login page where they must enter the password. After entering the correct password, they can browse the docs freely.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [vale] reported by reviewdog 🐶
[Microsoft.Contractions] Use 'they're' instead of 'they are'.


Replace `<YOUR PASSWORD>` with the password users will enter to access the docs.

When a user visits the documentation, they are redirected to a login page where they must enter the password. After entering the correct password, they can browse the docs freely.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [vale] reported by reviewdog 🐶
[FernStyles.Adverbs] Remove 'freely' if it's not important to the meaning of the statement.

```

<Warning>
The `FERN_AUTH_SECRET` in your login server must exactly match the secret set in the Dockerfile. If they differ, JWT verification will fail and users will not be able to log in.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [vale] reported by reviewdog 🐶
[Microsoft.Contractions] Use 'won't' instead of 'will not'.

Setting `FERN_AUTH_TEST_LOGIN="true"` enables the `/__test-login` endpoint on the container. When `FERN_AUTH_REDIRECT` points to this endpoint, unauthenticated users see a test login page with a single "Login with Test" button. Clicking the button mints a valid JWT and completes the authentication flow.

<Warning>
The test login page is intended for development and testing only. Do not enable `FERN_AUTH_TEST_LOGIN` in production environments.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [vale] reported by reviewdog 🐶
[Microsoft.Contractions] Use 'don't' instead of 'Do not'.

@github-actions
Copy link
Contributor

🌿 Preview your docs: https://fern-preview-7a2d775b-48a6-423a-80ba-a8b6dff2fd5f.docs.buildwithfern.com/learn

Here are the markdown pages you've updated:

@fern-support fern-support merged commit f26fd21 into main Feb 10, 2026
3 checks passed
@fern-support fern-support deleted the devin/1770707209-self-hosted-authentication branch February 10, 2026 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants