Skip to content

[Bug] Proxy does not forward credentials correctly for multi-staged authentication #19291

Open

Description

@michaeljmarshall

Search before asking

  • I searched in the issues and found nothing similar.

Version

Master (and presumably all others)

Minimal reproduce step

Bug discovered while reviewing the code. Inspect the lifecycle of the clientAuthData variable. The variable is set to the last authData received by the client, which means that for multi-staged authentication, it is not possible to forward the authentication credentials.

What did you expect to see?

I'd expect the protocol to either support forwarding these credentials or to fail when configured to do something it is unable to do correctly.

What did you see instead?

Described above.

Anything else?

For added context, I discussed this issue here: #18130 (comment).

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Activity

  1. added
    type/bug
    on Jan 19, 2023
  2. github-actions commented on Feb 19, 2023

    @github-actions

    The issue had no activity for 30 days, mark with Stale label.

  3. added
    bug-verified
    on Oct 24, 2026
  4. merlimat commented on Oct 24, 2026

    @merlimat
    Contributor

    Still present on master, and the code points at this issue itself. When forwardAuthorizationCredentials is enabled, ProxyConnection#handleConnect stores the first auth data (ProxyConnection.java:785). handleAuthResponse then overwrites it with each later client response and hands that to pending broker challenges (ProxyConnection.java:836). Both comments note that this only works for single-stage authentication. So with a multi-stage provider, the proxy can't forward credentials the broker can use, and it doesn't reject that configuration either. Handling it properly needs a protocol change.

  5. rokadepiyush49-rgb commented on Nov 22, 2026

    @rokadepiyush49-rgb

    I read through ProxyConnection. It looks like clientAuthData gets overwritten on every auth step:

    sequenceDiagram
      Client->>Proxy: auth step 1
      Proxy-->>Client: challenge
      Client->>Proxy: auth step 2
      Note over Proxy: step 1 is overwritten
      Proxy->>Broker: forwards step 2 only
      Note over Broker: not a valid credential
    
    Loading

    I see two ways to fix it: forward the authenticated role (probably needs a PIP), or fail at startup when forwardAuthorizationCredentials is used with a multi-stage provider. Would fail-fast plus a docs note be fine as a first step?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stalearea/proxybug-verifiedtype/bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions