-
Notifications
You must be signed in to change notification settings - Fork 983
Add SCRAM-SHA-256 (RFC 7804) #718
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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. |
httpclient5/src/main/java/org/apache/hc/client5/http/impl/ScramException.java
Outdated
Show resolved
Hide resolved
| StandardAuthScheme.BASIC)); | ||
| Collections.unmodifiableList(Arrays.asList( | ||
| StandardAuthScheme.BEARER, | ||
| StandardAuthScheme.SCRAM_SHA_256, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This order is of course questionable because if Bearer is peformed via client_credentials first it isn't better than SCRAM, from my PoV
httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/ScramScheme.java
Outdated
Show resolved
Hide resolved
httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/ScramScheme.java
Show resolved
Hide resolved
httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/ScramScheme.java
Outdated
Show resolved
Hide resolved
httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/ScramScheme.java
Outdated
Show resolved
Hide resolved
httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/ScramScheme.java
Outdated
Show resolved
Hide resolved
httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/ScramScheme.java
Outdated
Show resolved
Hide resolved
httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/ScramScheme.java
Outdated
Show resolved
Hide resolved
|
Please @michael-o do another pass |
httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/ScramScheme.java
Show resolved
Hide resolved
httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/ScramScheme.java
Outdated
Show resolved
Hide resolved
michael-o
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.