We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e2afc03 commit 01c60cdCopy full SHA for 01c60cd
aiokafka/conn.py
@@ -719,7 +719,13 @@ def __init__(
719
self._authenticator = self.authenticator_scram()
720
721
def first_message(self):
722
- client_first_bare = f"n={self._sasl_plain_username},r={self._nonce}"
+ # The characters ',' or '=' in usernames are sent as '=2C' and
723
+ # '=3D' respectively.
724
+ # https://datatracker.ietf.org/doc/html/rfc5802#section-5.1
725
+ quoted_username = (
726
+ self._sasl_plain_username.replace("=", "=3D").replace( ",", "=2C")
727
+ ) # fmt: skip
728
+ client_first_bare = f"n={quoted_username},r={self._nonce}"
729
self._auth_message += client_first_bare
730
return "n,," + client_first_bare
731
0 commit comments