def _generate_auth_token(self, channel_name):
subject = "<STR_LIT>".format(self.connection.socket_id, channel_name)<EOL>h = hmac.new(self.secret_as_bytes, subject.encode('<STR_LIT:utf-8>'), hashlib.sha256)<EOL>auth_key = "<STR_LIT>".format(self.key, h.hexdigest())<EOL>return auth_key<EOL>
Generate a token for authentication with the given channel.

        :param str channel_name: Name of the channel to generate a signature for.
        :rtype: str