Skip to content

fix(auth): configure Okta/OIDC scopes without changing defaults - #1551

Closed
Kvnbbg wants to merge 6 commits into
CopilotKit:mainfrom
Kvnbbg:fix/okta-oidc-scopes-1549
Closed

Kvnbbg wants to merge 6 commits into
CopilotKit:mainfrom
Kvnbbg:fix/okta-oidc-scopes-1549

Conversation

@Kvnbbg

@Kvnbbg Kvnbbg commented Nov 13, 2026 •

Copy link
Copy Markdown

Important

Blocked by upstream architecture change (2026-11-13). After this PR was opened, #1530 removed server/ and its tests from this public repository, replacing local server builds with published backend images. This branch still changes server/src/config.ts, server/src/auth/index.ts and server/tests/config.test.ts, which no longer exist on main. GitHub therefore reports merge conflicts. Do not resolve this by restoring the removed backend files: that would not modify the backend images used at runtime.

Maintainers: please port the OKTA_OAUTH_SCOPES parsing and the okta({ scopes }) pass-through into the backend's current source/build pipeline (or identify the appropriate contribution repository). Retain the default openid profile email when unset, reject a configured list without openid, and run the backend's config/auth tests plus an OIDC flow against an openid-only provider. The six-file patch here remains a reference implementation, not a merge-ready patch. The external-contributor CI run returned action_required with no jobs; no tests passed in CI.

Context

Addresses #1549: OpenBot's startup-configured Okta/OIDC provider always requested the default openid profile email scopes, rejecting providers that only support openid.

Changes

  • Add optional OKTA_OAUTH_SCOPES, accepting comma- or whitespace-separated values; reject configurations without openid.
  • Pass configured scopes to better-auth's okta() helper while preserving its existing defaults when unset.
  • Add focused config regression tests for defaults, openid-only, separators/deduplication, invalid scopes and missing credentials.
  • Document the optional setting in README, docs/configuration.md, and .env.example.

Verification

  • Reviewed existing config and auth source; confirmed no scopes were previously passed to okta().
  • Ran 6 isolated Node.js assertions for the new scope parsing semantics: passed.
  • Not yet run: repository bun test / TypeScript typecheck / CI because the full checkout and its dependencies are unavailable in this execution environment. Please keep this PR as a draft pending CI and integration tests. No claim of a production-verified OIDC flow.

AI-assisted change, reviewed against the current fork source.

Kvnbbg commented Nov 14, 2026

Copy link
Copy Markdown
Author

Verified blocker for #1551: Upstream #1530 (merged 2026-11-13, commit f71b0f4) deleted server/ from the public repository and switched runtime/backend builds to published images. The PR is now 63 commits behind main, and GitHub reports mergeable_state: dirty. This is not a routine rebase: restoring the removed server source would create dead code rather than fix the shipped backend.

I have marked the PR description as blocked and kept it as a draft. The implementation in this PR can be ported to the backend image source: parse an optional OKTA_OAUTH_SCOPES (comma/space-separated, must include openid) and forward scopes to okta(), preserving defaults when absent. We need a backend-source location and CI/OIDC integration verification before it can be merged.

The upstream CI run is action_required with no jobs executed; this is not evidence of a failing unit test.

@Kvnbbg

Kvnbbg commented Nov 14, 2026

Copy link
Copy Markdown
Author

@claude

@Kvnbbg

Kvnbbg commented Nov 14, 2026

Copy link
Copy Markdown
Author

@dustywusty

@Kvnbbg Kvnbbg closed this Nov 15, 2026
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.

1 participant