Skip to content

oauth exchange code of token getting 400 BAD REQUEST as client id is required #2806

Closed

Description

@davidkl97

OAuth2 exchange of code to access token fails on:

{
    "error": "invalid_request",
    "error_description": "authorization_code.client_id: Field required"
}

client_id is required according to RFC 6749

Activity

  1. added
    core
    on Aug 31, 2025
  2. added theissue type on Aug 31, 2025
  3. added
    tools
    and removed
    core
    on Nov 4, 2025
  4. added a commit that references this issue on Dec 4, 2025
    f273517
  5. joar commented on Mar 10, 2026

    @joar

    Do you have some more context about which OAuth Authorization Server you encountered this issue with?

    I encountered an issue caused by this change when trying to authenticate with Slack's MCP server (see example in #4782), and I believe the RFC might have been misinterpreted.

    RFC 6749 says (emphasis mine):

    client_id
    REQUIRED, if the client is not authenticating with the authorization server as described in Section 3.2.1.

    — RFC 6749 §4.1.3

    I believe the correct interpretation of this is that client_id is only required if the client is not authenticating with the server as described in section 3.2.1.

    The RFC doesn't clearly state that passing client_id is disallowed when other means of authentication are provided ‒ unless you count it as an authentication method ‒ which you can (it's at least 50% of the client_secret_post authentication method by parameters and placement), then this passage explicitly disallows passing it when using client_secret_basic or other methods:

    The client MUST NOT use more than one authentication method in each
    request.
    — RFC 6749 Section 2.3

    This interpretation seems to be shared with authlib, which:

    I think it's reasonable to propose that if authlib isn't compliant with RFC 6749, then the fix belongs in authlib and not ADK.

  6. added a commit that references this issue on Aug 11, 2026
    c9fa89f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

tools

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions