Skip to content
m manifester.io
All Kafka APIs

SaslAuthenticate

This page encodes the smallest legal instance of the request and the response: numeric fields are zero, strings and byte arrays are empty, every array carries exactly one sample element, and any records field holds one empty 61-byte RecordBatch v2. Version 2 is a flexible version, so every struct is terminated by a uvarint tagged-field count and strings and arrays carry compact length-plus-one prefixes. Sizes below include the leading int32 size prefix.

API key
36
Encoded at
v2
Flexible versions
2+
Headers
req v2, resp v1
Request versions
0-2
Response versions
0-2
Request size
17 bytes
Response size
22 bytes
framerpc headerrequest bodyRecordBatchRecordresponse bodytagged_fields

Request

SaslAuthenticateRequest v2, request header v2, 17 bytes on the wire

byte layout (17 bytes, 16 bytes per row)

0
1
2
3
4
5
6
7
8
9
A
B
C
D
E
F
0000
0010

object tree

SaslAuthenticateRequest      message v2                                   [0x0000, 17B]
+-- Frame                                                                 [0x0000, 4B]   length-delimited framing
|   +-- size                 int32            = 13                        [0x0000, 4B]   number of bytes that follow, patched after encoding
+-- RequestHeader            v2                                           [0x0004, 11B]  common request header
|   +-- request_api_key      int16            = 36 (SaslAuthenticate)     [0x0004, 2B]   numeric id of the API being invoked
|   +-- request_api_version  int16            = 2                         [0x0006, 2B]   version of the API being invoked
|   +-- correlation_id       int32            = 0                         [0x0008, 4B]   echoed back by the broker in the response
|   +-- client_id            nullable_string  = "" (int16 len=0)          [0x000c, 2B]   always a non-flexible int16-prefixed string
|   +-- tagged_fields        uvarint          = 0                         [0x000e, 1B]   number of tagged fields in the header
+-- SaslAuthenticateRequest  struct                                       [0x000f, 2B]   message body, version 2
    +-- AuthBytes            bytes            = empty (compact, len+1=1)  [0x000f, 1B]   The SASL authentication bytes from the client, as defined by the SASL mecha...
    +-- tagged_fields        uvarint          = 0                         [0x0010, 1B]   number of tagged fields in this struct

kafka message schema (.json)

{
  "apiKey": 36,
  "type": "request",
  "listeners": ["broker", "controller"],
  "name": "SaslAuthenticateRequest",
  // Version 1 is the same as version 0.
  // Version 2 adds flexible version support
  "validVersions": "0-2",
  "flexibleVersions": "2+",
  "fields": [
    { "name": "AuthBytes", "type": "bytes", "versions": "0+",
      "about": "The SASL authentication bytes from the client, as defined by the SASL mechanism." }
  ]
}

Response

SaslAuthenticateResponse v2, response header v1, 22 bytes on the wire

byte layout (22 bytes, 16 bytes per row)

0
1
2
3
4
5
6
7
8
9
A
B
C
D
E
F
0000
0010

object tree

SaslAuthenticateResponse      message v2                              [0x0000, 22B]
+-- Frame                                                             [0x0000, 4B]   length-delimited framing
|   +-- size                  int32       = 18                        [0x0000, 4B]   number of bytes that follow, patched after encoding
+-- ResponseHeader            v1                                      [0x0004, 5B]   common response header
|   +-- correlation_id        int32       = 0                         [0x0004, 4B]   matches the correlation_id of the request
|   +-- tagged_fields         uvarint     = 0                         [0x0008, 1B]   number of tagged fields in the header
+-- SaslAuthenticateResponse  struct                                  [0x0009, 13B]  message body, version 2
    +-- ErrorCode             int16       = 0                         [0x0009, 2B]   The error code, or 0 if there was no error.
    +-- ErrorMessage          string      = "" (compact, len+1=1)     [0x000b, 1B]   The error message, or null if there was no error.
    +-- AuthBytes             bytes       = empty (compact, len+1=1)  [0x000c, 1B]   The SASL authentication bytes from the server, as defined by the SASL mecha...
    +-- SessionLifetimeMs     int64       = 0                         [0x000d, 8B]   Number of milliseconds after which only re-authentication over the existing...
    +-- tagged_fields         uvarint     = 0                         [0x0015, 1B]   number of tagged fields in this struct

kafka message schema (.json)

{
  "apiKey": 36,
  "type": "response",
  "name": "SaslAuthenticateResponse",
  // Version 1 adds the session lifetime.
  // Version 2 adds flexible version support
  "validVersions": "0-2",
  "flexibleVersions": "2+",
  "fields": [
    { "name": "ErrorCode", "type": "int16", "versions": "0+",
      "about": "The error code, or 0 if there was no error." },
    { "name": "ErrorMessage", "type": "string", "versions": "0+", "nullableVersions": "0+",
      "about": "The error message, or null if there was no error." },
    { "name": "AuthBytes", "type": "bytes", "versions": "0+",
      "about": "The SASL authentication bytes from the server, as defined by the SASL mechanism." },
    { "name": "SessionLifetimeMs", "type": "int64", "versions": "1+", "default": "0", "ignorable": true,
      "about": "Number of milliseconds after which only re-authentication over the existing connection to create a new session can occur." }
  ]
}