-
Notifications
You must be signed in to change notification settings - Fork 119
Description
Description
The Atlassian remote MCP server fails to authenticate due to an issuer mismatch in the OAuth/OIDC discovery process. The server's well-known endpoint returns a different issuer URL than what is expected based on the server's base URL.
Steps to Reproduce
- Run
thv run atlassian-remote
- Observe authentication failure
Current Behavior
The authentication fails with the following error:
Error: failed to restart workload atlassian-remote: failed to authenticate to remote server:
remote authentication failed: failed to discover registration endpoint:
unable to discover OIDC endpoints at "https://mcp.atlassian.com/.well-known/openid-configuration"
or "https://mcp.atlassian.com/.well-known/oauth-authorization-server":
OIDC error: https://mcp.atlassian.com/.well-known/openid-configuration: HTTP 404,
OAuth error: https://mcp.atlassian.com/.well-known/oauth-authorization-server:
invalid metadata: issuer mismatch: expected https://mcp.atlassian.com,
got https://atlassian-remote-mcp-production.atlassian-remote-mcp-server-production.workers.dev
Expected Behavior
The OIDC discovery should handle cases where the issuer URL differs from the base URL, allowing successful authentication with the Atlassian remote MCP server.
Additional Context
The OAuth authorization server metadata returns:
{
"issuer": "https://atlassian-remote-mcp-production.atlassian-remote-mcp-server-production.workers.dev",
"authorization_endpoint": "https://mcp.atlassian.com/v1/authorize",
"token_endpoint": "https://atlassian-remote-mcp-production.atlassian-remote-mcp-server-production.workers.dev/v1/token",
"registration_endpoint": "https://atlassian-remote-mcp-production.atlassian-remote-mcp-server-production.workers.dev/v1/register",
// ... other fields
}
Note that the issuer
field contains a different domain than the base URL (mcp.atlassian.com
), which causes the validation to fail.
Proposed Solution
The OIDC discovery mechanism should be more flexible in handling issuer mismatches, possibly by:
- Allowing configuration to skip issuer validation
- Supporting an explicit issuer override in the configuration
- Accepting the issuer from the well-known endpoint when it's from a trusted domain pattern
Originally reported by @ariel-miculas in #199 (comment)