Sign-in setup.
On this page
k0rtex signs people in with OAuth 2.0 (authorization code flow with PKCE). You can configure
an OpenID Connect issuer, a GitHub OAuth app, or both. A board served only on localhost
needs neither: without a provider the browser acts as the board’s owner.
A hosted board (any origin other than loopback) refuses to start without HTTPS and at least one provider.
Before you start #
-
Decide the board’s public origin, for example
https://board.example.com, and set it asK0RTEX_BROWSER_URL. It must be the exact origin people type: scheme and host, an optional port, no path. Every redirect URI below is built from it. -
Put an HTTPS reverse proxy in front of the board that preserves the
Hostheader and does not buffer/apiand/mcp. -
Name the first administrator in
K0RTEX_ADMINS. On Kubernetes, these variables go in the board’s Secret (Kubernetes deployment). The board will not start with a provider configured and no administrator. Entries are comma separated:Entry Matches [email protected]An account whose verified email is this, from any provider oidc:<sub>The OIDC account with this subclaimgithub:<id>The GitHub account with this numeric id ( gh api user --jq .id)github:<login>The GitHub account with this login. A login can be renamed and taken by someone else: prefer the id K0RTEX_OIDC_SUBJECT=<sub>is the same as anoidc:<sub>entry and is kept for boards that had a single owner.
An administrator named here is made one at every sign-in. Removing an entry does not demote anyone: clear the flag under Settings → Users as well.
Variables #
| Variable | Value |
|---|---|
K0RTEX_BROWSER_URL |
The board’s public origin |
K0RTEX_ADMINS |
Administrators, as above |
K0RTEX_OIDC_ISSUER |
The issuer URL, exactly as its discovery document states it |
K0RTEX_OIDC_CLIENT_ID |
The client (application) id |
K0RTEX_OIDC_SECRET |
The client secret. Omit for a public client that uses PKCE alone |
K0RTEX_OIDC_NAME |
Label of the sign-in button, such as Google. Default: Single sign-on |
K0RTEX_OIDC_TRUST_EMAIL |
true to accept the issuer’s email claim without email_verified. See Email trust |
K0RTEX_OAUTH_GITHUB_CLIENT_ID |
A GitHub OAuth app’s client id |
K0RTEX_OAUTH_GITHUB_SECRET |
That app’s client secret |
Redirect URIs to register:
| Provider | Redirect URI |
|---|---|
| OIDC | <K0RTEX_BROWSER_URL>/api/v1/auth/callback |
| GitHub OAuth app | <K0RTEX_BROWSER_URL>/api/v1/auth/oauth/github/callback |
The board asks an OIDC issuer for the scopes openid email profile. It reads sub, email,
email_verified, name and picture from the ID token, and from the userinfo endpoint when
the ID token carries no email.
OpenID Connect providers #
Check the issuer first: curl <issuer>/.well-known/openid-configuration must answer, and its
issuer field must equal K0RTEX_OIDC_ISSUER character for character, trailing slash
included.
Google #
- In the Google Cloud console open APIs & Services → Credentials and create an OAuth client ID of type Web application.
- Add the OIDC redirect URI under Authorized redirect URIs.
- On the OAuth consent screen, choose Internal to limit sign-in to your Workspace.
K0RTEX_OIDC_ISSUER=https://accounts.google.com
K0RTEX_OIDC_CLIENT_ID=<client id>.apps.googleusercontent.com
K0RTEX_OIDC_SECRET=<client secret>
K0RTEX_OIDC_NAME=Google
K0RTEX_ADMINS=[email protected]Google sends email_verified, so email administrators, invitations and allowed domains work
as they are.
Microsoft Entra ID #
- In the Entra admin center open App registrations → New registration. Choose Accounts in this organizational directory only.
- Add a Web redirect URI with the OIDC redirect URI.
- Under Certificates & secrets create a client secret.
- Under Token configuration add the optional claim email to the ID token.
K0RTEX_OIDC_ISSUER=https://login.microsoftonline.com/<tenant id>/v2.0
K0RTEX_OIDC_CLIENT_ID=<application (client) id>
K0RTEX_OIDC_SECRET=<client secret value>
K0RTEX_OIDC_NAME=Microsoft
K0RTEX_OIDC_TRUST_EMAIL=true
K0RTEX_ADMINS=oidc:<your sub>Entra sends no email_verified claim, so invitations and allowed domains need
K0RTEX_OIDC_TRUST_EMAIL=true. Use it only with a single-tenant registration, as above. The
sub claim is specific to this app registration; to learn yours, sign in once and read the
oidc: value in the refusal’s server log, or decode the ID token.
Okta #
- Applications → Create App Integration → OIDC → Web Application.
- Grant type Authorization Code; add the OIDC redirect URI under Sign-in redirect URIs; assign the people or groups who may sign in.
K0RTEX_OIDC_ISSUER=https://<your-domain>.okta.com
K0RTEX_OIDC_CLIENT_ID=<client id>
K0RTEX_OIDC_SECRET=<client secret>
K0RTEX_OIDC_NAME=OktaWith a custom authorization server the issuer is
https://<your-domain>.okta.com/oauth2/<server id>.
Keycloak #
- In your realm create a client with Client authentication on and the Standard flow enabled.
- Set Valid redirect URIs to the OIDC redirect URI.
- Keep the
emailandprofileclient scopes as defaults.
K0RTEX_OIDC_ISSUER=https://keycloak.example.com/realms/<realm>
K0RTEX_OIDC_CLIENT_ID=k0rtex
K0RTEX_OIDC_SECRET=<client secret>Keycloak sends email_verified according to each user’s Email verified switch.
Any other issuer #
It needs OpenID discovery over HTTPS, the authorization code flow with PKCE (S256), and ID
tokens signed with RS256, PS256 or ES256. The token endpoint must accept
client_secret_basic or client_secret_post when a secret is set.
GitHub #
This OAuth app only signs people in. It is separate from the GitHub App that reads repositories (GitHub setup); do not reuse that app’s client id here.
- On GitHub open Settings → Developer settings → OAuth Apps → New OAuth App (for an organization: the organization’s settings).
- Homepage URL: the board’s origin. Authorization callback URL: the GitHub redirect URI above.
- Generate a client secret.
K0RTEX_OAUTH_GITHUB_CLIENT_ID=<client id>
K0RTEX_OAUTH_GITHUB_SECRET=<client secret>
K0RTEX_ADMINS=github:<your numeric id>The board asks for read:user user:email and uses the account’s primary verified email.
Someone whose GitHub account has no verified primary email can sign in only as a configured
github: administrator.
Where to put the variables #
Docker Compose. Put them in the repository-root .env (see .env.example) and run
mise run compose:up. Compose publishes the board on loopback; the reverse proxy reaches it
there.
Docker. Pass each one with -e, or --env-file.
Helm. Create a Secret with the variables and name it in existingSecret; set
publicHost to the board’s DNS name:
kubectl create secret generic k0rtex-auth \
--from-literal=K0RTEX_OIDC_ISSUER=https://accounts.google.com \
--from-literal=K0RTEX_OIDC_CLIENT_ID=... \
--from-literal=K0RTEX_OIDC_SECRET=... \
[email protected]From a checkout. Export them before mise run start.
First sign-in #
- Open the board. With one provider you are sent straight to it; with two you choose.
- Sign in as the administrator named in
K0RTEX_ADMINS. On a board that existed before sign-in, you become owner of the default organization, which holds its projects and workers. - Under Settings → Organizations invite people by email, or (as an administrator) set the email domains whose users join an organization on their own.
- Sign-in does not connect GitHub: the server needs its GitHub App’s ID and private key (setup).
Who is let in #
The provider proves who someone is; the board decides whether they get an account. An account is accepted when one of these holds:
- it is a configured administrator;
- an organization invited its verified email;
- its verified email is in a domain an organization allows.
Anyone else is refused with “Sign in with an account this board knows”, even with a valid login at the provider. Two accounts with the same verified email, one per provider, are one user.
Email trust #
Invitations, allowed domains and email administrators all rest on the provider vouching for
the email: the board ignores an email that is not marked verified. Set
K0RTEX_OIDC_TRUST_EMAIL=true only when the issuer is your own directory, where every
address is assigned by you. Never set it for an issuer where people choose their own email,
because whoever claims an address there becomes that user here.
Sessions and other clients #
- A browser session lasts eight hours. Sessions are kept in memory, so restarting the board signs everyone out.
- Disabling a user under Settings → Users ends their sessions at their next request.
K0RTEX_MCP_TOKENis a bearer token for a trusted MCP client. It acts as an administrator on/mcp/and the project knowledge and GitHub mounts.- Workers do not sign in. See Workers on a board with sign-in.
Troubleshooting #
| What you see | Cause |
|---|---|
| The board exits with “A hosted browser URL requires HTTPS and a sign-in provider” | K0RTEX_BROWSER_URL is not loopback and no provider is set, or it is http:// |
| The board exits with “Name the board’s first administrator” | A provider is set and K0RTEX_ADMINS / K0RTEX_OIDC_SUBJECT are empty |
| “OIDC discovery failed” (502) | The issuer URL is wrong or unreachable from the server, or its discovery document names a different issuer (often a trailing slash) |
| The provider reports a redirect URI mismatch | The registered URI differs from <K0RTEX_BROWSER_URL>/api/v1/auth/callback, or the proxy changes the host |
| “Authorization expired or belongs to another browser” (409) | The sign-in took more than ten minutes, was finished in another browser, or cookies are blocked |
| “Sign in with an account this board knows” (403) from a valid login | The account is no administrator, invitee or allowed-domain member; or its email is missing or unverified. Add the email claim or scope, or see Email trust |
| The same, for the administrator | The entry does not match: an email entry needs a verified email, oidc: needs the sub claim rather than an email, github: the login or numeric id |
| “This account is disabled” | An administrator disabled the user |
| A signed-in user sees no projects | They belong to no team with a grant. An organization owner or admin sees every project of the organization |
This page is docs/sign-in.md in the k0rtex repository. Suggest a change.