Meta tags:
description= Central OAuth 2.1 and OpenID Connect provider for Syntax properties - syntaxfm/auth;
Headings (most frequently used words):
navigation, syntax, repository, about, and, files, setup, footer, resources, stars, watchers, forks, auth, menu, latest, commit, history, folders, consumer, agent, prompts, what, d1, stores, cloudflare, local, development, register, an, oauth, client, for, fallback, consumers, oidc, health, releases, packages, used, by, contributors, languages, the, superseded, test,
Text of the page (most frequently used words):
the (104), and (78), auth (60), #syntax (46), local (40), pnpm (30), github (23), for (23), app (22), session (20), with (20), that (18), wrangler (17), test (16), oauth (15), api (15), only (15), server (12), config (12), caddy (12), this (11), https (11), client (11), dev (11), one (11), vite (11), use (10), better (10), sign (10), development (10), from (10), docker (10), you (9), packages (9), secret (9), name (9), central (8), remote (8), through (8), container (8), other (8), consuming_auth (8), origin (8), not (7), repository (7), openid (7), configuration (7), worker (7), proxy (7), first (7), setup (7), security (6), provider (6), health (6), registration (6), production (6), against (6), migration (6), same (6), cloudflare (6), run (6), preview (6), build (6), are (6), trust (6), its (6), out (6), which (6), files (6), syntaxfm (6), src (6), code (6), properties (5), readme (5), connect (5), after (5), before (5), any (5), service (5), mode (5), every (5), register (5), http (5), localhost (5), shared (5), sqlite (5), migrations (5), runs (5), serves (5), loopback (5), under (5), your (5), then (5), agent (5), signed (5), all (5), jsonc (5), they (5), request (5), host (5), cookie (5), json (5), navigation (4), forks (4), stars (4), resources (4), well (4), known (4), consumer (4), without (4), secrets (4), login (4), consent (4), oidc (4), add (4), skip (4), redirect (4), uri (4), com (4), callback (4), external (4), calls (4), account (4), including (4), flow (4), browser (4), those (4), open (4), remove (4), keep (4), else (4), hosts (4), certificate (4), when (4), still (4), projects (4), never (4), plugin (4), more (4), apps (4), image (4), their (4), main (4), developer (4), own (4), database (4), yaml (4), support (4), copilot (4), status (3), custom (3), about (3), dedicated (3), store (3), trusted (3), logout (3), enable (3), command (3), user (3), does (3), party (3), outside (3), url (3), migrate (3), drizzle (3), port (3), address (3), stand (3), start (3), them (3), runner (3), package (3), refuses (3), machine (3), added (3), file (3), data (3), may (3), have (3), routes (3), running (3), set (3), per (3), what (3), existing (3), see (3), workflows (3), must (3), __secure (3), domain (3), message (3), scripts (3), install (3), exec (3), work (3), commit (3), actions (3), quality (3), another (3), tab (3), window (3), refresh (3), reload (3), developers (3), changelog (3), customer (3), enterprise (3), grade (3), features (3), can (2), time (2), share (2), cookies (2), community (2), footer (2), used (2), report (2), watching (2), watchers (2), activity (2), curl (2), fail (2), verify (2), discovery (2), new (2), issuer (2), authorization (2), metadata (2), jwks (2), signing (2), pkce (2), better_auth_url (2), environment (2), binding (2), node (2), generated (2), omit (2), public (2), post (2), end (2), example (2), 3000 (2), has (2), platform (2), creates (2), temporary (2), admin (2), endpoint (2), applications (2), need (2), consumers (2), schema (2), directory (2), storing (2), apply (2), commands (2), tests (2), builds (2), free (2), lan (2), servers (2), 37960 (2), changes (2), check (2), generate (2), create (2), back (2), authority (2), root (2), removing (2), relies (2), started (2), holds (2), anything (2), inspect (2), ids (2), lab (2), nothing (2), sets (2), piece (2), desktop (2), whose (2), coding (2), over (2), ssh (2), mac (2), each (2), variables (2), starts (2), private (2), always (2), header (2), both (2), plain (2), read (2), lib (2), hooks (2), applies (2), stop (2), neither (2), committed (2), answers (2), built (2), text (2), 403 (2), naming (2), deploy (2), put (2), better_auth_secret (2), auth_cookie_domain (2), tables (2), task (2), integrate (2), following (2), blob (2), exactly (2), acceptance (2), checks (2), domains (2), conventions (2), subdomain (2), prompts (2), items (2), tsconfig (2), svelte (2), workspace (2), lock (2), eslint (2), dockerfile (2), prettierrc (2), prettierignore (2), gitignore (2), dockerignore (2), last (2), commits (2), latest (2), menu (2), star (2), settings (2), insights (2), universe (2), training (2), integrations (2), stories (2), center (2), documentation (2), learn (2), business (2), fixes (2), products (2), perform, action, personal, information, manage, contact, docs, privacy, terms, 2026, inc, languages, contributors, releases, deployment, updating, returns, opening, requiring, get, available, retains, jwt, scopes, default, protections, profile, email, offline_access, requires, authentication, marks, initializes, exposing, script, performs, hashing, storage, printed, once, immediately, application, manager, unless, cannot, hold, required, registered, applying, applied, dynamic, unauthenticated, remain, disabled, loads, supported, directly, satisfy, authenticated, creation, requirement, detaches, deletes, admincreateoauthclient, during, fallback, intentionally, generation, declares, inventing, credentials, unit, integration, signs, real, front, also, ins, routed, broken, upstreams, ports, none, touches, keychain, misses, fails, instead, acting, sudo, osascript, state, dir, lint, typegen, useful, lines, everything, etc, block, installs, match, fingerprint, volumes, confirm, volume, certificates, whichever, was, possibly, replace, delete, whole, tls, website, earlier, versions, names, macos, supersedes, architecture, removes, current, entries, affect, deliberately, checking, belongs, something, superseded, opens, orbstack, privileged, helper, show, dialogs, shell, isn, says, restart, counts, even, empty, string, already, screen, lets, too, works, syntax_dev_setup_dialogs, allow, false, vitest, node_test_context, ssh_tty, ssh_connection, pi_coding_agent, claudecode, publishes, watches, turns, off, rate, limiting, members, pulls, cli, token, lives, envs, yml, ghcr, browsers, addresses, vpn, reach, validated, picks, ones, checked, sent, present, equal, caller, but, send, validating, trusts, lookup, refreshed, reaches, asked, ends, carries, expires, would, local_session_cookies, dev_proxy, stops, however, process, again, needs, adapter, reads, ignored, replaces, click, serving, way, page, route, skips, there, doesn, gets, origins, accepts, deploys, top, level, invalid_origin, 127, local_server, configure, dashboard, dns, active, github_client_secret, non, subdomains, receive, values, openssl, rand, base64, github_client_id, authenticate, provisioned, bound, array, fields, encoded, columns, dates, integer, millisecond, timestamps, booleans, integers, matching, oauth_consent, oauth_refresh_token, oauth_access_token, oauth_client, verification, initial, stores, cross, project, tracked, dex, second, specific, histories, stay, section, paste, these, into, being, integrated, detail, say, case, defines, contract, boundary, safe, return, integrating, standalone, sveltekit, deployed, named, view, date, folders, history, tags, branches, fork, change, notification, notifications, pull, requests, issues, dismiss, alert, switched, accounts, appearance, search, pricing, event, talks, workshops, next, partners, company, forum, events, webinars, blog, resource, premium, advanced, ons, why, evaluate, industries, government, manufacturing, financial, services, healthcare, industry, nonprofits, startups, team, enterprises, stage, businesses, source, improvements, across, place, articles, sponsors, trending, repos, explore, customize, certifications, scanning, leak, prevention, protection, vulnerability, detection, remediation, secure, cloud, environments, codespaces, analysis, enforcement, automation, ship, tasks, automated, hosting, review, collaboration, content,
Text of the page (random words):
ip actions ci cd and automation code quality quality analysis fixes and enforcement codespaces cloud development environments secure code security vulnerability detection and remediation secret protection secret scanning and leak prevention all features developers learn documentation training certifications build build with copilot customize copilot integrations explore trending repos github sponsors developer articles changelog changelog your source for the latest features improvements and fixes across github products all in one place businesses by stage enterprises team startups nonprofits by industry healthcare financial services manufacturing government see all industries evaluate github why github customer stories business insights trust center add ons github advanced security enterprise grade code security copilot for business enterprise grade ai features premium support enterprise grade 24 7 support resources learn connect documentation resource center blog events webinars community forum customer stories integrations support customer support training github status company about partners changelog github universe github universe the event for developers by developers talks workshops and what s next for github pricing search sign in sign up appearance settings you signed in with another tab or window reload to refresh your session you signed out in another tab or window reload to refresh your session you switched accounts on another tab or window reload to refresh your session dismiss alert message syntaxfm auth repository navigation code issues pull requests actions projects security and quality insights more items auth public notifications you must be signed in to change notification settings fork 0 0 star 0 0 you must be signed in to star a repository about central oauth 2 1 and openid connect provider for syntax properties resources readme activity custom properties stars 0 stars watchers 0 watching forks 0 forks report repository main branches tags go to file code open more actions menu latest commit history 33 commits 33 commits folders and files name name last commit message last commit date github workflows github workflows migrations migrations packages auth local packages auth local scripts scripts src src dockerignore dockerignore gitignore gitignore prettierignore prettierignore prettierrc prettierrc consuming_auth md consuming_auth md dockerfile dockerfile readme md readme md drizzle config ts drizzle config ts eslint config js eslint config js package json package json pnpm lock yaml pnpm lock yaml pnpm workspace yaml pnpm workspace yaml svelte config js svelte config js tsconfig json tsconfig json vite config ts vite config ts worker configuration d ts worker configuration d ts wrangler jsonc wrangler jsonc view all files repository files navigation readme more items syntax auth standalone sveltekit auth and oauth 2 1 oidc provider for syntax deployed as a cloudflare worker production syntax fm applications share the one central better auth session from this service they do not create per app auth or session tables this service is auth only and d1 only its dedicated d1 database is named syntax auth integrating an app read consuming_auth md it defines the central first party session contract trust boundary safe login return flow central logout local development against a local syntax auth and the oidc flow for external domains consumer agent prompts paste one of these into an agent session in the app being integrated consuming_auth md holds every detail so the prompts only say which case applies for an app on syntax fm or a syntax fm subdomain integrate this app with syntax auth by following https github com syntaxfm auth blob main consuming_auth md exactly including its local development section and acceptance checks this app runs on syntax fm or a syntax fm subdomain so use the shared session keep this app s existing conventions for an app on any other domain integrate this app with syntax auth by following https github com syntaxfm auth blob main consuming_auth md exactly including its acceptance checks this app runs outside syntax fm so use the external domains openid connect flow keep this app s existing conventions cross project auth and development setup work is tracked in lab s dex this repository does not have a second task store for the same work app specific task histories stay with their apps what d1 stores the initial migration creates only the better auth and oauth provider tables user account session and verification jwks oauth_client oauth_access_token oauth_refresh_token and oauth_consent oauth array and metadata fields are json encoded sqlite text columns dates are integer millisecond timestamps and booleans are sqlite integers matching better auth 1 6 23 s generated sqlite schema cloudflare setup the syntax auth d1 database is provisioned in the syntax cloudflare account and bound in wrangler jsonc install node 22 and pnpm then authenticate wrangler pnpm install pnpm exec wrangler login better_auth_url auth_cookie_domain and github_client_id are committed as non secret worker variables in wrangler jsonc production sets auth_cookie_domain syntax fm so trusted first party subdomains receive the central session cookie store only the private values as worker secrets and generate better_auth_secret with openssl rand base64 32 pnpm exec wrangler secret put better_auth_secret pnpm exec wrangler secret put github_client_secret apply the migration to the dedicated remote d1 database then deploy pnpm d1 migrate remote pnpm deploy in the cloudflare dashboard open the syntax auth worker add the custom domain auth syntax fm and verify its dns and certificate are active configure the github oauth app callback url https auth syntax fm api auth callback github local development pnpm install pnpm dev pnpm dev stops the shared syntax auth container if one is running applies migrations to local d1 and serves http localhost 37960 pnpm preview does the same with a production build both run through scripts local_server js however they stop they stop every process they started and start the container again so other syntax apps keep signing in neither needs secrets and neither changes anything else on the machine the cloudflare adapter reads the committed local wrangler environment which has a loopback url no shared cookie domain and a local only d1 database under the ignored wrangler directory in that mode syntax auth replaces github with a one click local developer account user id local developer and answers only localhost 127 0 0 1 and 1 under vite dev pnpm dev and vite preview the docker image a plugin in vite config ts answers every request for any other host including api health and built files with a plain text 403 naming the host and the address to use before vite s own host check or file serving src hooks server ts refuses other hosts the same way for every page and auth route so wrangler dev pnpm preview which skips the vite plugin still refuses them there it serves api health and built files to any host in local mode a request from an origin local syntax auth doesn t trust gets better auth s 403 invalid_origin with a message naming the origin and the origins it accepts deploys use the top level configuration and never enable local mode browsers on other addresses a lan or vpn address or a developer s own https name never reach this server they sign in through their app s development proxy from packages auth local which calls it on loopback and sign out through that proxy or through their app s own sign out endpoint whose server calls it on loopback with the browser origin it validated see consuming_auth md local development per request src hooks server ts picks host only cookies __secure ones for a browser on https from the session cookie s name or from a checked x syntax auth dev origin header sent by the proxy or an app server src lib server dev_proxy ts when origin is present it must equal that header a loopback caller may omit origin but consumer sign out servers send both after validating the browser origin the service then trusts that one origin for the request it serves local api auth calls before its own session lookup so a refreshed cookie always reaches the app server that asked a local sign out ends the session of each session cookie the request carries plain and __secure and a sign in on http expires a __secure one that would be read before it src lib server local_session_cookies ts consumer apps run the same service from the private ghcr io syntaxfm auth local docker image which github workflows local image yml publishes from main the image serves a production build with vite preview which watches no files local mode turns off better auth s rate limiting as dev builds always have the packages auth local vite plugin starts it and for syntaxfm members pulls it with their github cli login without storing the token see consuming_auth md the port lives in packages auth local container js vite config ts and the local and oauth registration envs in wrangler jsonc no dev server and no syntax auth local opens docker desktop or orbstack whose first run and privileged helper can show dialogs from an ai coding agent s shell claudecode or pi_coding_agent set over ssh ssh_connection or ssh_tty in ci ci under a test runner node_test_context or vitest or outside the mac s desktop session if docker isn t running the app runs signed out and says to start docker then restart dev each of those variables counts when set at all even to an empty string 0 or false when docker already runs the local syntax auth container still starts syntax_dev_setup_dialogs allow at the mac s screen lets an agent s run open docker too it never works over ssh in ci or under a test runner the superseded syntax test setup earlier versions of the plugin set up https syntax test names on macos the per app development proxy supersedes that architecture nothing sets it up or relies on it any more and nothing removes what it added current apps do not need those resources existing routes trust and hosts entries may still affect other projects if you remove them do so deliberately one piece at a time after checking that the piece belongs to that setup and not to something else on the machine caddy routes the setup added routes with the ids syntax test auth syntax test lab syntax test website and syntax test tls to whichever caddy was running possibly one shared with other projects inspect its configuration through caddy s admin api first and remove only those ids never replace or delete the whole configuration a syntax caddy container with syntax caddy data and syntax caddy config volumes if the setup started one confirm with docker inspect that it is that container before removing it the data volume holds caddy s local certificate authority and certificates back it up first if anything else may have used it trust in caddy s local root certificate other caddy installs use the same caddy local authority name so match the trusted certificate s fingerprint against the root in the caddy data you are removing and remove that trust only when no caddy you still use relies on it the hosts file block back up etc hosts first then remove only the lines from syntax test added by syntax dev setup through syntax test and keep everything else useful commands pnpm check pnpm lint pnpm test pnpm build pnpm preview pnpm cf typegen pnpm db generate pnpm d1 migration create migration name pnpm test runs the unit tests an integration test that builds the app serves it with vite preview on a free port with a temporary d1 and signs in on localhost and through the real development proxy from packages auth local in front of it as a browser on a lan address and on an https name and the packages auth local tests also pnpm dir packages auth local test those run the proxy against stand ins for local syntax auth routed servers and broken upstreams on free loopback ports and the container start against a stand in docker none of them touches port 37960 the container or wrangler state under a test runner the package refuses to run osascript sudo open docker or a security command that changes the keychain so a test that misses a stand in fails instead of acting on your machine drizzle config ts is intentionally generation only it declares the sqlite schema and migrations directory without inventing a local sqlite url or storing cloudflare credentials apply migrations with wrangler s d1 migrate local and d1 migrate remote commands register an oauth client for fallback consumers production first party syntax fm applications use the shared central session and do not need an oauth client including during local development registration is only for consumers outside syntax fm that use the oidc flow dynamic and unauthenticated client registration remain disabled the registration command loads the d1 binding through wrangler s supported platform proxy and calls better auth s server only auth api admincreateoauthclient api directly it creates a one use better auth session to satisfy the api s authenticated client creation requirement detaches the new client and deletes the temporary user account and session in the same command it does not add an http admin endpoint register against local d1 after pnpm dev has applied the local migration pnpm oauth register name external app local redirect uri http localhost 3000 auth callback post logout redirect uri http localhost 3000 skip consent enable end session register against remote d1 after applying the remote migration pnpm oauth register remote name external app redirect uri https example com auth callback post logout redirect uri https example com skip consent enable end session remote registration requires wrangler authentication the dedicated oauth registration wrangler environment marks only the d1 binding as remote and initializes better auth in local mode without exposing production worker secrets to the node script better auth performs the client secret hashing and storage the generated client secret is printed once so store it immediately in the client application s secret manager omit skip consent unless the client is trusted add public for a client that cannot hold a secret pkce is required for every registered client oidc and health the issuer is better_auth_url api auth the provider retains github login jwt jwks signing the openid profile email offline_access scopes sign in consent and better auth s default pkce protections discovery metadata is available at api auth well known openid configuration api auth well known oauth authorization server well known oauth authorization server api auth get api health returns status ok service syntax auth without opening d1 or requiring auth secrets after deployment verify health and discovery before updating any consumer to use the new issuer curl fail https auth syntax fm api health curl fail https auth syntax fm api auth well known openid configuration about central o...
|