Add SCRAM-SHA-256 (RFC 7804)#718
Conversation
|
As far as I understood the SASL SCRAM mech it was always connection-bound which always contracted the multistream nature of h2. How does this reconcile? E.g., PHA or NTLM on h2 are completely not working. |
|
I hope this can finally kill Digest scheme. |
IMO we’re fine on h2 because this is HTTP SCRAM (RFC 7804) which is per-request—no channel binding (GS2 “n,,” / c=biws)—so each stream carries its own exchange. |
So one round is enough to complete auth? |
SCRAM needs two exchanges: client-first → 401 (server-first), then client-final → 200 with Authentication-Info (v=). |
So from a client's perspective, it is always stateful, right? From the server's perspective, it can be stateful. How can this be bound to an h2 stream, if h2 is used? For instance, SPNEGO/Kerberos only works reliably via h2 IF there is a single roundtrip only, everything else is undefined per sé. |
Client keeps only transient handshake state (nonce/authMessage/expected-v) per request/stream, not per connection. |
Ah, perfect. This is what I wanted to hear. As long it is associated with the stream only and not the connection I am fine with that in general. |
| StandardAuthScheme.BASIC)); | ||
| Collections.unmodifiableList(Arrays.asList( | ||
| StandardAuthScheme.BEARER, | ||
| StandardAuthScheme.SCRAM_SHA_256, |
There was a problem hiding this comment.
This order is of course questionable because if Bearer is peformed via client_credentials first it isn't better than SCRAM, from my PoV
|
Please @michael-o do another pass |
michael-o
left a comment
There was a problem hiding this comment.
I don't have any objections, but at least some other committer should look over!
Agree. thank you @michael-o |
ok2c
left a comment
There was a problem hiding this comment.
@arturobernalg There is nothing I can say. If it is good enough for @michael-o it must be good enough for me.
How confident are you however about the implementation? Should not we make it experimental for a release cycle?
Marking as experimental sounds like a good idea. |
Implements HTTP SCRAM with SCRAM-SHA-256 per RFC 7804 and SCRAM mechanics per RFC 5802/7677.
@ok2c @michael-o agree to make it @experimental for a release cycle |
Implement SCRAM-SHA-256 auth (RFC 7804/5802/7677) for HttpClient. Full round-trip with constant-time server signature verification from Authentication-Info, SASLprep and zeroized secrets, correct header quoting, optional preemptive client-first, and iteration policy warnings.