Skip to content

OIDC issuer mismatch prevents authentication with Atlassian remote MCP server #1957

@JAORMX

Description

@JAORMX

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

  1. Run thv run atlassian-remote
  2. 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:

  1. Allowing configuration to skip issuer validation
  2. Supporting an explicit issuer override in the configuration
  3. Accepting the issuer from the well-known endpoint when it's from a trusted domain pattern

Originally reported by @ariel-miculas in #199 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    authenticationbugSomething isn't workingcliChanges that impact CLI functionalityregistry

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions