def _generate_signature(self, header, payload):
        key = self.SECRET_KEY.encode('utf-8')
        data = "{0}.{1}".format(header, payload).encode('utf-8')
        hash_func = self.HASH_FUNCTIONS[self.HASH_ALGORITHM]

        hmac_obj = hmac.new(key, data, digestmod=hash_func)
        digest = hmac_obj.hexdigest().encode('utf-8')
        signature = b64encode(digest).decode('utf-8')
        return signature
Generate signature for the token.
dataset/ETHPy150Open Relrin/aiorest-ws/aiorest_ws/auth/token/managers.py/JSONWebTokenManager._generate_signature