Skip to content

Cross-Tenant Agent Sharing Failure with Dynamic OAuthΒ #16472

Description

@talhelfgott666

Describe the bug

Hey team! πŸ‘‹

First off, thanks for all the work on the Agent Toolkit β€” it's been great to work with. I ran into something I can't quite figure out and would love a hand.

I've built an agent using the Agent Toolkit, with Dynamic OAuth for our MCP server.

ai-plugin.json

    "runtimes": [
        {
            "type": "RemoteMCPServer",
            "spec": {
                "url": "..",
                "mcp_tool_description": {
                    "file": "mcp-tools.json"
                }
            },
            "run_for_functions": [
                "execute_endpoint",
                "execute_write_endpoint",
                "fetch",
                "find_endpoints",
                "get_endpoint_detail",
                "get_endpoints",
                "search"
            ],
            "auth": {
                "type": "OAuthPluginVault",
                "reference_id": "${{MCP_DA_AUTH_ID_AIGATEWAYT}}"
            }
        }
    ]
}

declarativeAgent.json

{
    "$schema": "https://developer.microsoft.com/json-schemas/copilot/declarative-agent/v1.7/schema.json",
    "version": "v1.7",
...
    "actions": [
        {
            "id": "action_1",
            "file": "ai-plugin.json"
        }
    ]
}

What happens

1. In my own org β€” everything works great βœ…

When I install the agent and ask a question, I get the sign-in prompt as expected:

Image

I sign in, and I get my answer. πŸŽ‰

2. In a second account β€” no sign-in prompt at all ❌

I exported the agent (zipped it) and uploaded it to another account we have. When I ask a question there, no sign-in button ever shows up:

Image

Extra detail (-developer on)

I turned on developer mode to compare the two.

Main account:

Image

Shared account:

Image

My guess

It looks like sharing the agent doesn't also share the plugin / MCP / connector behind it β€” so the second account has no auth configuration to trigger a sign-in against. Happy to be wrong here though! πŸ™‚

What we're trying to do

We'd like to publish this agent (and its MCP server) so all of our users can use it. Our setup only supports dynamic OAuth β€” static isn't an option for us.

Is this expected behavior, and is there a supported path for distributing an agent with a dynamic-OAuth MCP server across accounts? Any pointers would be hugely appreciated. Thanks so much! πŸ™

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs attentionThis issue needs the attention of a contributor.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions