Package org.asynchttpclient.scram
Class ScramMessageParser
- java.lang.Object
-
- org.asynchttpclient.scram.ScramMessageParser
-
public final class ScramMessageParser extends Object
Parser for SCRAM protocol messages (RFC 5802) and HTTP authentication headers (RFC 7804). Thread-safe: all methods are stateless.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classScramMessageParser.ScramChallengeParamsParsed SCRAM HTTP challenge/response parameters from WWW-Authenticate header.static classScramMessageParser.ServerFinalMessageParsed server-final-message fields.static classScramMessageParser.ServerFirstMessageParsed server-first-message fields.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ScramMessageParser.ServerFinalMessageparseServerFinal(String message)Parse a server-final-message (RFC 5802):v=<verifier>ORe=<error>static ScramMessageParser.ServerFirstMessageparseServerFirst(String message)Parse a server-first-message (RFC 5802):r=<nonce>,s=<salt>,i=<count>[,extensions]static ScramMessageParser.ScramChallengeParamsparseWwwAuthenticateScram(String headerValue)Parse SCRAM-specific parameters from a WWW-Authenticate or Authentication-Info header value.static voidvalidateGs2Header(String message)Validate the gs2-header starts with "n" (no channel binding).static voidvalidateNoncePrefix(String clientNonce, String fullNonce)Validate that the full nonce starts with the client nonce.
-
-
-
Method Detail
-
parseServerFirst
public static ScramMessageParser.ServerFirstMessage parseServerFirst(String message)
Parse a server-first-message (RFC 5802):r=<nonce>,s=<salt>,i=<count>[,extensions]
-
parseServerFinal
public static ScramMessageParser.ServerFinalMessage parseServerFinal(String message)
Parse a server-final-message (RFC 5802):v=<verifier>ORe=<error>
-
parseWwwAuthenticateScram
public static ScramMessageParser.ScramChallengeParams parseWwwAuthenticateScram(String headerValue)
Parse SCRAM-specific parameters from a WWW-Authenticate or Authentication-Info header value. The header value should have the SCRAM-SHA-xxx prefix already stripped (or the full header).
-
validateNoncePrefix
public static void validateNoncePrefix(String clientNonce, String fullNonce)
Validate that the full nonce starts with the client nonce.
-
validateGs2Header
public static void validateGs2Header(String message)
Validate the gs2-header starts with "n" (no channel binding).
-
-