use user_scope param for Slack OAuth

This commit is contained in:
CREDO23 2026-04-22 09:54:16 +02:00
parent 3638d72b29
commit 820326e3ee
2 changed files with 4 additions and 2 deletions

View file

@ -165,7 +165,7 @@ async def connect_mcp_service(
"state": state,
}
if svc.scopes:
auth_params["scope"] = " ".join(svc.scopes)
auth_params[svc.scope_param] = " ".join(svc.scopes)
auth_url = f"{auth_endpoint}?{urlencode(auth_params)}"
@ -478,7 +478,7 @@ async def reauth_mcp_service(
"state": state,
}
if svc.scopes:
auth_params["scope"] = " ".join(svc.scopes)
auth_params[svc.scope_param] = " ".join(svc.scopes)
auth_url = f"{auth_endpoint}?{urlencode(auth_params)}"

View file

@ -21,6 +21,7 @@ class MCPServiceConfig:
client_id_env: str | None = None
client_secret_env: str | None = None
scopes: list[str] = field(default_factory=list)
scope_param: str = "scope"
MCP_SERVICES: dict[str, MCPServiceConfig] = {
@ -46,6 +47,7 @@ MCP_SERVICES: dict[str, MCPServiceConfig] = {
supports_dcr=False,
client_id_env="SLACK_CLIENT_ID",
client_secret_env="SLACK_CLIENT_SECRET",
scope_param="user_scope",
scopes=[
"search:read.public", "search:read.private", "search:read.mpim",
"search:read.im", "search:read.files", "search:read.users",