Sign in with GitHub
This lesson turns sign-in on for the local deployment. People sign in with GitHub, and the GitHub team they belong to decides which services they can open.
You will add spec.identity to the profile, create and install a GitHub
App during olf infra deploy, and sign in as an analyst, in about 25 minutes.
Start from the project of lesson 7: the Full preset on a local deployment, so that Superset, Dagster and OpenMetadata all run. You also need a GitHub organization where you can create teams and install an app, and a GitHub account that is a member of it.
How sign-in works
Section titled “How sign-in works”Without spec.identity, authentication is off and every service opens with
administrator rights. With it, a sign-in perimeter sits in front of every
service. The perimeter sends people to Dex, which asks GitHub who they are and
which of the mapped teams they belong to, and the highest role among those
teams is the role they get.
The four roles, highest first, are platform-admin, data-engineer,
analyst and viewer. The rights per service are in
Roles and permissions. Owning the
GitHub organization grants nothing: only members of a mapped team can sign in.
1. Create the teams
Section titled “1. Create the teams”In your GitHub organization, create four teams. The slugs below are the ones this lesson uses; any slugs work if the profile names them:
| Team | Role |
|---|---|
olf-platform-admins |
platform-admin |
olf-data-engineers |
data-engineer |
olf-analysts |
analyst |
olf-viewers |
viewer |
Add your own account to olf-platform-admins for now.
2. Add spec.identity
Section titled “2. Add spec.identity”Keep the profile from the earlier lessons and add the identity block under
spec. Replace my-org with the organization login exactly as GitHub shows
it, case included:
spec: access: tls: none identity: issuer: github github: organization: my-org teams: platform-admin: [olf-platform-admins] data-engineer: [olf-data-engineers] analyst: [olf-analysts] viewer: [olf-viewers] oauth_app_secret_ref: name: github-oauth-appoauth_app_secret_ref names the Kubernetes Secret that will hold the GitHub
App’s credentials. You do not create it: the next step does. A role you leave
out of teams is held by nobody. Every field is in the
Deployment Profile reference.
olf profile validate --project .3. Deploy and connect GitHub
Section titled “3. Deploy and connect GitHub”This lesson turns sign-in on for a fresh deployment. Start it clean:
olf infra destroy --provider localolf infra deploy --provider localSwitching an existing authentication-off stack to GitHub sign-in in place is not covered yet.
The GitHub step comes first, while you are still at the terminal:
olf infra deploynotices that the Secretgithub-oauth-appdoes not exist and prints a URL to confirm a GitHub App. The browser opens on it; on WSL the URL is opened through Windows whenexplorer.exeis available. Either way the URL is printed, so you can open it yourself.- In the browser, select Create GitHub App. The app is created in your organization, private to it, with read access to members and email addresses.
- GitHub sends the browser back to
olf, which stores the app’s credentials in the Secret and sends the browser on to the app’s install page. - On the install page, install the app on your organization.
olf infra deploy waits up to 15 minutes for step 2. After that it runs unattended
and no further input is needed. It only asks in an interactive terminal; in CI
it fails on a missing Secret instead, and --no-github-connect does the same
by choice. Credentials are never printed.
The deployment ends with the portal URL and the state of the app:
GitHub App installed on my-orgIf it prints Install the GitHub App on my-org: <link> instead, open the link
and install the app. Without the installation, nobody can sign in. To run the
GitHub step on its own later, see
Connect GitHub.
4. Sign in on the portal
Section titled “4. Sign in on the portal”Open a private browser window on the portal:
http://olf.localhostYou are sent to GitHub, then back through Dex to the portal, with no password
prompt from OpenLakeForge: GitHub owns your password and two-factor
authentication. The portal lists the services. As platform-admin you can open
all of them, and the portal links to the organization’s teams page in GitHub,
where membership is managed.
5. What each role sees
Section titled “5. What each role sees”Move your account between teams in GitHub (organization, Teams) and sign in again to see each role. The portal, Dagster, Trino UI and Superset follow at sign-in. OpenMetadata roles come from a role sync that runs every 5 minutes, not from sign-in: wait for it, or run it now:
export KUBECONFIG="$HOME/.openlakeforge/state/local/kubeconfig.yaml""$(olf toolchain path kubectl)" -n olf-system create job --from=cronjob/openmetadata-role-sync role-sync-nowUse a new job name each time you run it.
| Role | Superset | Dagster | Trino UI | OpenMetadata |
|---|---|---|---|---|
platform-admin |
Admin |
opens | opens | Admin |
data-engineer |
Alpha |
opens | opens | write |
analyst |
Gamma |
denied | denied | read |
viewer |
read-only | denied | denied | read |
A service the role does not open answers with an “Access is role-restricted” page and a link back to the portal.
6. Plain HTTP or HTTPS
Section titled “6. Plain HTTP or HTTPS”The default profile serves plain HTTP on *.olf.localhost (tls: none).
It needs no certificate step, and it is allowed only on a *.localhost
domain, which is reachable from your machine alone. Sign-in works over it.
To serve HTTPS, name the platform’s own CA as the issuer:
spec: access: tls: local-caRun olf infra deploy --provider local again, then trust the CA in your browser:
olf infra access trustIt writes the CA certificate and prints the commands for your platform. Skip it and the browser warns on every host.
Trino has no sign-in of its own: every caller sends its own token, and Polaris decides what each query reads. The Trino UI opens as a fixed user behind the perimeter, which admits data engineers and platform admins.
The GitHub App records the callback URL for the scheme it was created with.
After switching scheme, run olf infra secrets rotate github-app to register an app
with the new URL, and install it again.
7. Authentication off
Section titled “7. Authentication off”A profile with no spec.identity runs with authentication off: every service
opens with administrator rights and nobody signs in. olf allows that only
where nothing is published beyond your machine: on a *.localhost domain
locally, and on AWS or Azure without spec.access. It is what olf init
writes, and what lessons 1 to 7 used.
8. Try the access model
Section titled “8. Try the access model”This procedure uses one GitHub account that plays every role by moving between
teams. Your account must be in olf-platform-admins only at the start. Use a
fresh private window for each sign-in.
- The admin adds an analyst. In GitHub, move your account from
olf-platform-adminstoolf-analysts. Note the time. - The analyst signs in. Open the portal (
http://olf.localhost, orhttps://olf.localhostif you switched to HTTPS). You pass through GitHub and Dex to the portal, with no password prompt, and the portal lists the services. - The analyst reaches Superset. Open it from the portal. It opens signed in, with no login form. Open a dashboard and check it renders.
- The analyst is denied Dagster. Open Dagster from the portal. The page answers 403 “Access is role-restricted”, with a link back to the portal. The Trino UI is denied the same way.
- A user outside the teams is denied. Remove your account from every OpenLakeForge team. If you own the organization, you stay an owner, and that is the point. Sign in from a fresh window. The sign-in is refused, with Dex’s page explaining why, and no session exists.
- A removed member loses access. Add your account back to
olf-analystsand sign in. Then remove it from the team without signing out. At the first request at least 4 minutes after your sign-in or the last refresh, the perimeter re-reads your teams and refuses you. Note the time from removal to refusal; it stays within about 5 minutes. - Automation is unaffected. While you try the steps above,
olf infra e2e run --env localstill passes, and the OpenMetadata ingestion and dbt runs keep working. They use service credentials, not a person’s session.
When you finish, put your account back in olf-platform-admins.
Sign out
Section titled “Sign out”Select Sign out in the portal header to end your session on every service behind the perimeter. It clears the perimeter cookie and lands on a “signed out” page. Superset keeps its own session: its Logout menu item does the same. GitHub’s session stays open, so signing in again usually does not prompt; Dex re-reads your teams at each sign-in.
The easy alternative is a private window: closing it drops every cookie. A team change also takes effect without signing out, within the 5-minute refresh bound described in Add, change or remove a member.
Check it worked
Section titled “Check it worked”This lesson ends on a person’s access, so check it in the browser. Signed in as an analyst, Superset opens and renders a dashboard, and Dagster answers “Access is role-restricted”. Signed in with an account that is in no mapped team, GitHub’s sign-in is followed by Dex’s refusal page, which links to the troubleshooting steps.
What you learned
Section titled “What you learned”spec.identityturns sign-in on; a GitHub team decides each person’s role.olf infra deploycreates and stores the GitHub App for you, then you install it on the organization.- Membership is managed in GitHub, and a removed member is refused within minutes, not at the next deploy.
- Plain HTTP is the default locally;
tls: local-cawitholf infra access trustgives HTTPS.
Add PROD and promote a revision. To manage members, rotate secrets or recover when GitHub is unreachable, see the identity guides.
Synced from openlakeforge @ v0.6.0-alpha.3 (882b426), docs/tutorial/08-sign-in-with-github.md.