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
* Registers an OAuth client with Sim's authorization server by writing the
* `oauth_client` row directly, the way `register-sso-provider.ts` registers
* an SSO provider. Better Auth's own `adminCreateOAuthClient` endpoint needs a
* signed-in session, and dynamic registration is deliberately switched off,
* so an operator creates clients here.
*
* Usage: bun run apps/sim/scripts/create-oauth-client.ts
*
* Required environment variables:
* DATABASE_URL
* BETTER_AUTH_SECRET The deployment's auth secret; the stored secret is encrypted under it
* OAUTH_CLIENT_ID=my-app Stable identifier the app sends as client_id
* OAUTH_CLIENT_NAME="My App" Shown on the consent page
* OAUTH_REDIRECT_URIS=https://my-app.example/callback,https://… Comma-separated. Exact match, except a loopback-IP URI, which matches any port (RFC 8252 §7.3) — register it without one
*
* Optional:
* OAUTH_CLIENT_PUBLIC=true A native/CLI app that cannot keep a secret (PKCE only, no secret issued)
* OAUTH_CLIENT_URI=https://… Homepage stored in the client's metadata
* OAUTH_CLIENT_LOGO_URI=https://… Logo stored in the client's metadata
*
* Required for least privilege:
* OAUTH_SCOPES=api:read Comma-separated scopes the client may request
*
* A confidential client's secret is generated here, encrypted the way the