Uh oh!
There was an error while loading. Please reload this page.
This repository was archived by the owner on Aug 6, 2026. It is now read-only.
- Notifications
You must be signed in to change notification settings - Fork 66
fix(auth): Revert OAuth scopes to wildcard to fix prod login#3668
Merged
Uh oh!
There was an error while loading. Please reload this page.
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -4,218 +4,13 @@ export const POSTHOG_US_CLIENT_ID = "HCWoE0aRFMYxIxFNTTwkOORn5LBjOt2GVDzwSw5W"; | ||
| export const POSTHOG_EU_CLIENT_ID = "AIvijgMS0dxKEmr5z6odvRd8Pkh5vts3nPTzgzU9"; | ||
| export const POSTHOG_DEV_CLIENT_ID = "DC5uRLVbGI02YQ82grxgnK6Qn12SXWpCqdPb60oZ"; | ||
| // Mirrors the scopes PostHog advertises as grantable: OAUTH_SCOPES_SUPPORTED in the API's | ||
| // services/mcp/src/lib/oauth-scopes.generated.ts, published as scopes_supported at | ||
| // /.well-known/oauth-authorization-server, plus the one privileged scope (llm_gateway:read) | ||
| // the LLM gateway requires, which the advertised set excludes. Requesting this explicit set | ||
| // instead of "*" keeps the token least-privilege; the privileged extra is granted via this | ||
| // app's seeded scope ceiling. Keep in sync with that generated list; bump OAUTH_SCOPE_VERSION | ||
| // below whenever the set changes. | ||
| export const OAUTH_SCOPES = [ | ||
| "access_control:read", | ||
| "access_control:write", | ||
| "account:read", | ||
| "account:write", | ||
| "action:read", | ||
| "action:write", | ||
| "activity_log:read", | ||
| "activity_log:write", | ||
| "agent_approvals:read", | ||
| "agent_approvals:write", | ||
| "agents:read", | ||
| "agents:write", | ||
| "alert:read", | ||
| "alert:write", | ||
| "annotation:read", | ||
| "annotation:write", | ||
| "approvals:read", | ||
| "approvals:write", | ||
| "batch_export:read", | ||
| "batch_export:write", | ||
| "batch_import:read", | ||
| "batch_import:write", | ||
| "business_knowledge:read", | ||
| "business_knowledge:write", | ||
| "cohort:read", | ||
| "cohort:write", | ||
| "comment:read", | ||
| "comment:write", | ||
| "conversation:read", | ||
| "conversation:write", | ||
| "customer_analytics:read", | ||
| "customer_analytics:write", | ||
| "customer_journey:read", | ||
| "customer_journey:write", | ||
| "customer_profile_config:read", | ||
| "customer_profile_config:write", | ||
| "dashboard:read", | ||
| "dashboard:write", | ||
| "dashboard_template:read", | ||
| "dashboard_template:write", | ||
| "data_catalog:read", | ||
| "data_catalog:write", | ||
| "data_catalog_approval:read", | ||
| "data_catalog_approval:write", | ||
| "dataset:read", | ||
| "dataset:write", | ||
| "early_access_feature:read", | ||
| "early_access_feature:write", | ||
| "element:read", | ||
| "element:write", | ||
| "email", | ||
| "endpoint:read", | ||
| "endpoint:write", | ||
| "engineering_analytics:read", | ||
| "engineering_analytics:write", | ||
| "error_tracking:read", | ||
| "error_tracking:write", | ||
| "evaluation:read", | ||
| "evaluation:write", | ||
| "event_definition:read", | ||
| "event_definition:write", | ||
| "event_filter:read", | ||
| "event_filter:write", | ||
| "experiment:read", | ||
| "experiment:write", | ||
| "experiment_holdout:read", | ||
| "experiment_holdout:write", | ||
| "experiment_saved_metric:read", | ||
| "experiment_saved_metric:write", | ||
| "export:read", | ||
| "export:write", | ||
| "external_data_schema:read", | ||
| "external_data_schema:write", | ||
| "external_data_source:read", | ||
| "external_data_source:write", | ||
| "feature_flag:read", | ||
| "feature_flag:write", | ||
| "field_note:read", | ||
| "field_note:write", | ||
| "file_system:read", | ||
| "file_system:write", | ||
| "file_system_shortcut:read", | ||
| "file_system_shortcut:write", | ||
| "group:read", | ||
| "group:write", | ||
| "health_issue:read", | ||
| "health_issue:write", | ||
| "heatmap:read", | ||
| "heatmap:write", | ||
| "hog_flow:read", | ||
| "hog_flow:write", | ||
| "hog_function:read", | ||
| "hog_function:write", | ||
| "ingestion_warning:read", | ||
| "ingestion_warning:write", | ||
| "insight:read", | ||
| "insight:write", | ||
| "insight_variable:read", | ||
| "insight_variable:write", | ||
| "integration:read", | ||
| "integration:write", | ||
| "legal_document:read", | ||
| "legal_document:write", | ||
| "link:read", | ||
| "link:write", | ||
| "live_debugger:read", | ||
| "live_debugger:write", | ||
| "llm_analytics:read", | ||
| "llm_analytics:write", | ||
| "llm_prompt:read", | ||
| "llm_prompt:write", | ||
| "llm_provider_key:read", | ||
| "llm_provider_key:write", | ||
| "llm_skill:read", | ||
| "llm_skill:write", | ||
| "logs:read", | ||
| "logs:write", | ||
| "loop:read", | ||
| "loop:write", | ||
| "marketing_analytics:read", | ||
| "marketing_analytics:write", | ||
| "mcp_analytics:read", | ||
| "mcp_analytics:write", | ||
| "metrics:read", | ||
| "metrics:write", | ||
| "notebook:read", | ||
| "notebook:write", | ||
| "openid", | ||
| "organization:read", | ||
| "organization:write", | ||
| "organization_integration:read", | ||
| "organization_integration:write", | ||
| "organization_member:read", | ||
| "organization_member:write", | ||
| "person:read", | ||
| "person:write", | ||
| "plugin:read", | ||
| "plugin:write", | ||
| "product_enablement:read", | ||
| "product_enablement:write", | ||
| "product_tour:read", | ||
| "product_tour:write", | ||
| "profile", | ||
| "project:read", | ||
| "project:write", | ||
| "property_definition:read", | ||
| "property_definition:write", | ||
| "query:read", | ||
| "query:write", | ||
| "replay_scanner:read", | ||
| "replay_scanner:write", | ||
| "revenue_analytics:read", | ||
| "revenue_analytics:write", | ||
| "session_recording:read", | ||
| "session_recording:write", | ||
| "session_recording_playlist:read", | ||
| "session_recording_playlist:write", | ||
| "sharing_configuration:read", | ||
| "sharing_configuration:write", | ||
| "signal_scout:read", | ||
| "signal_scout:write", | ||
| "streamlit_app:read", | ||
| "streamlit_app:write", | ||
| "subscription:read", | ||
| "subscription:write", | ||
| "survey:read", | ||
| "survey:write", | ||
| "tagger:read", | ||
| "tagger:write", | ||
| "task:read", | ||
| "task:write", | ||
| "ticket:read", | ||
| "ticket:write", | ||
| "tracing:read", | ||
| "tracing:write", | ||
| "uploaded_media:read", | ||
| "uploaded_media:write", | ||
| "usage_metric:read", | ||
| "usage_metric:write", | ||
| "user:read", | ||
| "user:write", | ||
| "user_interview:read", | ||
| "user_interview:write", | ||
| "vision_action:read", | ||
| "vision_action:write", | ||
| "visual_review:read", | ||
| "visual_review:write", | ||
| "warehouse_objects:read", | ||
| "warehouse_objects:write", | ||
| "warehouse_table:read", | ||
| "warehouse_table:write", | ||
| "warehouse_view:read", | ||
| "warehouse_view:write", | ||
| "web_analytics:read", | ||
| "web_analytics:write", | ||
| "webhook:read", | ||
| "webhook:write", | ||
| // Privileged: the embedded agent's model calls go through PostHog's LLM gateway | ||
| // (gateway.{region}.posthog.com), which requires this scope. Not in the advertised set | ||
| // above; granted via this app's seeded ceiling. Without it the gateway 403s every call. | ||
| "llm_gateway:read", | ||
| ]; | ||
| // Wildcard, not the explicit scope list: the prod OAuth apps have no seeded scope ceiling, | ||
| // so /oauth/authorize rejects the privileged llm_gateway:read with invalid_scope while "*" | ||
| // is grandfathered. Re-land the explicit list only after the US and EU app ceilings are | ||
| // seeded with ["@default", "llm_gateway:read"]. Bump OAUTH_SCOPE_VERSION on any change. | ||
| export const OAUTH_SCOPES = ["*"]; | ||
charlesvien marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| export const OAUTH_SCOPE_VERSION = 6; | ||
| export const OAUTH_SCOPE_VERSION = 5; | ||
| // Token refresh settings | ||
| export const TOKEN_REFRESH_BUFFER_MS = 30 * 60 * 1000; // 30 minutes before expiry | ||
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.