Skip to content

feat: removes SSO gate check for temp token auth - #3814

Merged
akshaydeo merged 1 commit into
devfrom
05-27-feat_removes_sso_gate_check_for_temp_token_auth
May 27, 2026
Merged

feat: removes SSO gate check for temp token auth#3814
akshaydeo merged 1 commit into
devfrom
05-27-feat_removes_sso_gate_check_for_temp_token_auth

Conversation

@roroghost17

@roroghost17 roroghost17 commented May 27, 2026

Copy link
Copy Markdown
Contributor

Summary

The "Allow Temp Token Auth Links" toggle in the MCP settings view was previously gated behind a SCIM/SSO enterprise check. This PR removes that gate so the setting is visible and configurable for all users, regardless of enterprise tier or SSO configuration.

Changes

  • Removed the isSCIMEnabled conditional that wrapped the Temp Token Auth UI section, making it always visible in the MCP settings view.
  • Removed the unused IS_ENTERPRISE import and useGetAuthTypeQuery hook from mcpView.tsx since they were only used to compute isSCIMEnabled.
  • Minor formatting cleanup: removed a blank line at the start of InitiateUserOAuthFlow and reformatted a single-line mock method in the config test file.

Type of change

  • Bug fix
  • Feature
  • Refactor
  • Documentation
  • Chore/CI

Affected areas

  • Core (Go)
  • Transports (HTTP)
  • Providers/Integrations
  • Plugins
  • UI (React)
  • Docs

How to test

  1. Navigate to the MCP settings view in the Bifrost dashboard on a non-enterprise or non-SSO instance.
  2. Confirm the "Allow Temp Token Auth Links" toggle is now visible and functional.
  3. Toggle the setting and verify it saves correctly.
# UI
cd ui
pnpm i || npm i
pnpm test || npm test
pnpm build || npm run build

Screenshots/Recordings

The "Allow Temp Token Auth Links" section should now appear unconditionally in the MCP settings view, rather than only when SCIM/SSO is enabled.

Breaking changes

  • Yes
  • No

Related issues

Security considerations

The Temp Token Auth feature issues short-lived scoped tokens to allow unauthenticated users to complete MCP OAuth flows. Exposing this toggle to all users does not change the underlying token security model, but operators should be aware of the implications of enabling this setting in their environment.

Checklist

  • I read docs/contributing/README.md and followed the guidelines
  • I added/updated tests where appropriate
  • I updated documentation where needed
  • I verified builds succeed (Go and UI)
  • I verified the CI pipeline passes locally if applicable

@CLAassistant

CLAassistant commented May 27, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@coderabbitai

coderabbitai Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: dcf00a57-6dc0-480d-8ad9-58694eff1d31

📥 Commits

Reviewing files that changed from the base of the PR and between 9f4fc9d and c439f29.

📒 Files selected for processing (3)
  • framework/oauth2/main.go
  • transports/bifrost-http/lib/config_test.go
  • ui/app/workspace/config/views/mcpView.tsx
💤 Files with no reviewable changes (1)
  • framework/oauth2/main.go

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Enhanced OAuth flow management with improved per-user session handling and state security.
    • "Allow Temp Token Auth Links" setting is now consistently available in MCP configuration settings.
  • Tests

    • Updated test formatting for configuration utilities.

Walkthrough

The PR reintroduces the InitiateUserOAuthFlow method in the OAuth2 backend framework and removes enterprise/SCIM gating from the MCPView frontend component. The backend method handles per-user OAuth session management with optional temp token minting; the frontend now unconditionally renders the temp token auth link control.

Changes

Per-user OAuth flow and temp token authentication

Layer / File(s) Summary
OAuth flow initiation implementation
framework/oauth2/main.go
InitiateUserOAuthFlow loads template OAuth config, resolves caller identity by flowMode, generates CSRF/PKCE credentials, performs per-user session row upsert (reusing pending rows), builds frontend auth URL, and optionally mints mcp_auth temp token in URL fragment.
MCPView temp token UI ungating
ui/app/workspace/config/views/mcpView.tsx
Removed IS_ENTERPRISE constant and useGetAuthTypeQuery hook dependencies. Updated component initialization to derive config directly without isSCIMEnabled flag. Temp token auth section now always renders instead of conditionally, maintaining disabled state based on hasSettingsUpdateAccess.
Test mock formatting
transports/bifrost-http/lib/config_test.go
Reformatted MockConfigStore.DeleteMCPPerUserHeaderFlow from single-line to multi-line stub; behavior and signature unchanged.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • maximhq/bifrost#3565: Refactors per-user OAuth flow handling around flowMode-driven InitiateUserOAuthFlow contract and mode/identity-based session/token lookup in the same OAuth2Provider APIs.
  • maximhq/bifrost#3728: Tests toggling mcp_enable_temp_token_auth and asserting is-auth-enabled/token fields, aligning with the conditional temp-token minting now enabled in the OAuth2 user flow.

Suggested reviewers

  • akshaydeo
  • danpiths

Poem

🐰 OAuth flows now freed from gating chains,
Per-user sessions roam through cleaner lanes,
Temp tokens mint when enabled and bright,
Frontend controls step boldly into light—
hop toward seamless user delight! 🌟

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main feature: removing the SSO/enterprise gate that previously restricted visibility of the temp token auth toggle.
Description check ✅ Passed The description is comprehensive and well-structured, covering all key template sections including summary, changes, type, affected areas, testing, and security considerations.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 05-27-feat_removes_sso_gate_check_for_temp_token_auth

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.12.2)

level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies"


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@roroghost17
roroghost17 marked this pull request as ready for review May 27, 2026 13:15
@greptile-apps

greptile-apps Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

Safe to merge — the change is a targeted UI gate removal with no logic mutations in the non-UI files.

All three files contain straightforward, complete changes: the unused imports and derived state are fully removed in the React file, and the Go files only touch whitespace. The toggle itself wires into the same standard config-save path used by every other setting on this page, so no new code paths are introduced.

No files require special attention.

Important Files Changed

Filename Overview
ui/app/workspace/config/views/mcpView.tsx Removes SSO/SCIM gate around temp token auth toggle; cleans up now-unused IS_ENTERPRISE import, useGetAuthTypeQuery hook call, and isSCIMEnabled variable
framework/oauth2/main.go Removes a superfluous blank line at the start of InitiateUserOAuthFlow — no logic change
transports/bifrost-http/lib/config_test.go Reformats DeleteMCPPerUserHeaderFlow mock stub from single-line to multi-line — no logic change

Reviews (1): Last reviewed commit: "feat: removes SSO gate check for temp to..." | Re-trigger Greptile

@coderabbitai
coderabbitai Bot requested review from akshaydeo and danpiths May 27, 2026 13:17

akshaydeo commented May 27, 2026

Copy link
Copy Markdown
Contributor

Merge activity

  • May 27, 1:42 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • May 27, 1:43 PM UTC: @akshaydeo merged this pull request with Graphite.

@akshaydeo
akshaydeo merged commit cc68666 into dev May 27, 2026
14 of 15 checks passed
@akshaydeo
akshaydeo deleted the 05-27-feat_removes_sso_gate_check_for_temp_token_auth branch May 27, 2026 13:43
akshaydeo pushed a commit that referenced this pull request May 29, 2026
## Summary

The "Allow Temp Token Auth Links" toggle in the MCP settings view was previously gated behind a SCIM/SSO enterprise check. This PR removes that gate so the setting is visible and configurable for all users, regardless of enterprise tier or SSO configuration.

## Changes

- Removed the `isSCIMEnabled` conditional that wrapped the Temp Token Auth UI section, making it always visible in the MCP settings view.
- Removed the unused `IS_ENTERPRISE` import and `useGetAuthTypeQuery` hook from `mcpView.tsx` since they were only used to compute `isSCIMEnabled`.
- Minor formatting cleanup: removed a blank line at the start of `InitiateUserOAuthFlow` and reformatted a single-line mock method in the config test file.

## Type of change

- [ ] Bug fix
- [x] Feature
- [ ] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [ ] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [x] UI (React)
- [ ] Docs

## How to test

1. Navigate to the MCP settings view in the Bifrost dashboard on a non-enterprise or non-SSO instance.
2. Confirm the "Allow Temp Token Auth Links" toggle is now visible and functional.
3. Toggle the setting and verify it saves correctly.

```sh
# UI
cd ui
pnpm i || npm i
pnpm test || npm test
pnpm build || npm run build
```

## Screenshots/Recordings

The "Allow Temp Token Auth Links" section should now appear unconditionally in the MCP settings view, rather than only when SCIM/SSO is enabled.

## Breaking changes

- [ ] Yes
- [x] No

## Related issues

## Security considerations

The Temp Token Auth feature issues short-lived scoped tokens to allow unauthenticated users to complete MCP OAuth flows. Exposing this toggle to all users does not change the underlying token security model, but operators should be aware of the implications of enabling this setting in their environment.

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [ ] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable
@akshaydeo akshaydeo mentioned this pull request May 29, 2026
18 tasks
akshaydeo added a commit that referenced this pull request May 29, 2026
## Summary

This PR releases **core v1.5.14**, **framework v1.3.14**, **transports v1.5.6**, and bumps all dependent plugins to their respective `.14` patch versions. It delivers a broad set of new capabilities across MCP authentication, key rotation, OTel metrics, Bedrock/Anthropic compatibility, and UI improvements, alongside a number of targeted bug fixes and refactors.

## Changes

- **Direct API Key Header** — Providers can now receive an API key passed directly via a request header (#3817)
- **MCP Per-User Auth** — Introduced `MCPCredentialStore` abstraction, per-user MCP credential reconciliation, and a new per-user header auth type with lazy-auth submission flow (#3656, #3702, #3703, #3704, #3705)
- **MCP TLS Configuration** — Added configurable TLS (`insecureSkipVerify`, `caCertPem`) for HTTP/SSE MCP client connections (#3779, #3783)
- **MCP Sessions Management** — Filter, search, and pagination on the MCP sessions list API and table, plus a `can_reauth` identity gate (#3823, #3824, #3825)
- **Key Rotation** — Keys now rotate on 401/402/403 responses; returns `502 upstream_credentials_exhausted` when all keys are permanently exhausted. Added `triggered_rotation` to `KeyAttemptRecord` and tightened `bifrost_key_rotation_events_total` semantics (#3430, #3491)
- **OTel Metrics** — Added OTel spec-compatible metrics (backward compatible) with provider cache and semantic cache attributes in metrics export (#3865, #3816)
- **Opus 4.8 Support** — System message handling and general compatibility for Opus 4.8 (#3868, #3878)
- **Dimension Rankings** — New `GetDimensionRankings` API and dashboard tabs for team, customer, BU, and user rankings (#3766)
- **Model Pricing Attributes** — `additional_attributes` field on model pricing rows with management API and UI editor (#3829)
- **Prompt Cache Retention** — Added prompt cache retention parameter on responses requests (#3810)
- **Tool Call Execution UI** — Inline tool-call execution, stop streaming, bulk execute/submit, and a redesigned tool-call UI (#3837, #3843)
- **Sheet Navigation** — Prev/next keyboard navigation and URL state across virtual key, MCP client, and routing rule sheets (#3739, #3740, #3744, #3745)
- **Bedrock Tool Name Truncation** — Truncate Bedrock function/tool names to the provider length limit
- **Bedrock Guardrails** — Set guardrail config in Bedrock requests built from responses (#3862)
- **Anthropic Tool Use** — Default `tool_use` input to `{}` when arguments are absent (#3880)
- **Responses Streaming** — Fixed responses stream events (#3838)
- **Compat Flow** — Fixed missing parameter parsing on the compat flow (#3881)
- **Passthrough API Version** — Set a default API version in passthrough requests as a fallback (#3853)
- **Virtual Key Updates** — Avoid overriding optional fields during virtual key update (#3855)
- **User-Mode Flows** — Gate user-mode flows on caller `user_id`, skip temp token mint, and unify flow/credential kind filtering for pending flows (#3841, #3859)
- **Partial Tool Calls** — Handle partial tool call execution failures and return successful results (#3849)
- **URL Query Escaping** — Support escaped characters in URL query parameters (#3826)
- **MCP Auth Errors** — Inline banner and retry support for MCP auth-required errors (#3856)
- **Renamed Resolvers** — `staticHeadersResolver`/`serverOAuthResolver` renamed to `sharedHeadersResolver`/`sharedOAuthResolver` (#3840)
- **Starlark Nested Tool Calls** — Exposed `RunWithPluginPipeline` on `ClientManager` and routed Starlark nested tool calls through the canonical plugin gate (#3794)
- **Deferred-Fill OAuth Removed** — Removed deferred-fill user-mode OAuth flow support (#3839)
- **Go 1.26.3** — Upgraded toolchain to Go 1.26.3 (#3782)

## Type of change

- [x] Bug fix
- [x] Feature
- [x] Refactor
- [ ] Documentation
- [x] Chore/CI

## Affected areas

- [x] Core (Go)
- [x] Transports (HTTP)
- [x] Providers/Integrations
- [x] Plugins
- [x] UI (React)
- [ ] Docs

## How to test

```sh
# Core/Transports
go version  # should report go1.26.3
go test ./...

# UI
cd ui
pnpm i || npm i
pnpm test || npm test
pnpm build || npm run build
```

- Validate MCP per-user auth by configuring a per-user header auth type and confirming credentials are stored and reconciled on virtual key and MCP client changes.
- Validate key rotation by triggering a 401/402/403 from an upstream provider and confirming rotation occurs; exhaust all keys and confirm a `502 upstream_credentials_exhausted` is returned.
- Validate OTel metrics output includes `provider_cache` and `semantic_cache` attributes.
- Validate Bedrock requests with tool names exceeding the provider limit are truncated correctly.
- Validate Opus 4.8 system message handling by sending a request with a system message to an Opus 4.8 endpoint.

## Breaking changes

- [x] Yes
- [ ] No

The deferred-fill user-mode OAuth flow has been removed (#3839). Any integrations relying on that flow must migrate to the new per-user credential store approach. The `staticHeadersResolver` and `serverOAuthResolver` identifiers have been renamed to `sharedHeadersResolver` and `sharedOAuthResolver` respectively (#3840); any direct references must be updated.

## Related issues

#3817, #3656, #3702, #3703, #3704, #3705, #3779, #3783, #3823, #3824, #3825, #3430, #3491, #3865, #3816, #3868, #3878, #3766, #3829, #3810, #3837, #3843, #3739, #3740, #3744, #3745, #3862, #3880, #3838, #3881, #3853, #3855, #3841, #3859, #3849, #3826, #3856, #3840, #3794, #3839, #3782, #3724, #3814, #3836, #3869, #3886

## Security considerations

- MCP per-user credentials are stored via the new `MCPCredentialStore` abstraction; ensure the backing store is appropriately access-controlled and that credential values are encrypted at rest.
- The direct API key header feature passes provider secrets via HTTP headers; ensure TLS is enforced on all ingress paths and that headers are not logged in plaintext.
- User-mode flows are now gated on `caller user_id` and temp token minting is skipped where appropriate, reducing the surface for privilege escalation.
- TLS configuration for MCP HTTP/SSE connections supports `insecureSkipVerify`; this should only be enabled in controlled environments.

## Checklist

- [x] I read `docs/contributing/README.md` and followed the guidelines
- [x] I added/updated tests where appropriate
- [x] I updated documentation where needed
- [x] I verified builds succeed (Go and UI)
- [x] I verified the CI pipeline passes locally if applicable
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.

3 participants