Skip to content

feat: delegated OAuth access for workflow runs - #1585

Open
shaileshpadave wants to merge 2 commits into
feature/agent-url-top-levelfrom
feat/delegated-oauth-workflow-runs
Open

feat: delegated OAuth access for workflow runs#1585
shaileshpadave wants to merge 2 commits into
feature/agent-url-top-levelfrom
feat/delegated-oauth-workflow-runs

Conversation

@shaileshpadave

@shaileshpadave shaileshpadave commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Stacked on #1447.

Adds delegated OAuth access so workflows can require a user to authorize an external provider (e.g. Microsoft) before running. User clicks Authorize once, consents via popup, and the refresh token gets stored as a Conductor secret. All subsequent runs — including scheduled ones — just pick it up from there, no re-auth needed.

On the Run Workflow page, each required delegation shows as an Authorize / Connected / Disconnect row. The Run button stays disabled until everything is authorized.

Config needed: set conductor.oauth.microsoft.{tenant-id,client-id,client-secret} and register {base-url}/api/oauth/callback as a redirect URI in your Azure app registration.

Adds support for workflows that require a user to authorize access to
an external provider (e.g. Microsoft) before running. The authorization
is done once via an OAuth popup; the resulting refresh token is stored
as a Conductor secret and reused on all subsequent runs — including
scheduled ones.

Backend:
- DelegationRequirement model in WorkflowDef — declares which provider,
  scopes, and secret name a workflow needs
- OAuthController: GET /api/oauth/authorize (returns auth URL) and
  GET /api/oauth/callback (exchanges code → refresh token, stores
  secret, closes popup via postMessage)
- OAuthTokenService: builds Microsoft authorization URLs and handles
  the token exchange via the standard auth-code flow
- application.properties: conductor.oauth.microsoft.* config keys

UI (RunWorkflow page):
- DelegatedAuthSection component — shows per-delegation Authorize/
  Connected/Disconnect state, opens popup, listens for postMessage
- RunWorkflow.tsx — renders DelegatedAuthSection when the selected
  workflow has requiredDelegations; disables Run until all are authorized
- WorkflowDef type extended with requiredDelegations field
…rter task form

- Rename agentType constant "azure-foundry" → "microsoft-foundry" (A2AService,
  AgentTaskMetadata, all UI badge/display/routing references)
- Add endpoint + credentialRef to AgentSummary DTO; populate both in
  AzureFoundryAgentClient.listExternalAgents() so the global /agent/list scan
  carries connection metadata per discovered agent
- AgentController: expose optional endpoint/credentialRef query params on GET /agent/list
  to support on-demand Foundry agent listing
- AgentTaskForm: remove manual "Foundry project URL" and "Credential secret" inputs;
  use global /agent/list filtered to microsoft-foundry type; selecting an agent
  auto-populates agentUrl, credentialRef (as ${workflow.secrets.<name>}), and
  rawConfig.assistantId in one shot
- AzureFoundryAgentClient: add resolveCredField() to handle both a secret-name lookup
  and a pre-resolved JSON blob (when Conductor substitutes ${workflow.secrets.X} at
  task execution time)
- agentMetadata: fix agentSourceIdentity to show rawConfig.assistantId (agent name)
  for microsoft-foundry tasks instead of the project URL; fix resolveAgentSnapshot
  to build snapshot locally for microsoft-foundry, preventing erroneous POST to
  /a2a/agent-card with an agent name as the URL
- AgentDefinitions: update provider chips, icons, and colors for microsoft-foundry
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