You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] Proxy does not forward credentials correctly for multi-staged authentication #19291
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).
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.
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?
Activity
github-actions commentedon Feb 19, 2023
The issue had no activity for 30 days, mark with Stale label.
merlimat commentedon Oct 24, 2026
Still present on master, and the code points at this issue itself. When
forwardAuthorizationCredentialsis enabled,ProxyConnection#handleConnectstores the first auth data (ProxyConnection.java:785).handleAuthResponsethen 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.rokadepiyush49-rgb commentedon Nov 22, 2026
I read through
ProxyConnection. It looks likeclientAuthDatagets overwritten on every auth step:I see two ways to fix it: forward the authenticated role (probably needs a PIP), or fail at startup when
forwardAuthorizationCredentialsis used with a multi-stage provider. Would fail-fast plus a docs note be fine as a first step?