JWT could not be verified [SOLVED]

Hi,

As per the documentation for sending a message to PubSub from my EBS, my JWT is formatted as such:

jwt_payload = {
    'exp': time.time() + 60,
    'channel_id': str(user_id),
    'user_id': str(user_id),
    'role': 'external',
    'pubsub_perms': {'send': ['*']}
}

jwt_payload = jwt.encode(jwt_payload, SECRET) # SECRET is already base64 decoded

headers = {
    'Authorization': 'Bearer ' + jwt_payload,
    'Client-Id': API_KEY,
    'Content-Type': 'application/json'
}

Upon POSTing my request to the PubSub message endpoint, I receive this response:

{"error":"Forbidden","status":403,"message":"{\n  \"status\": 403,\n  \"message\": \"JWT could not be verified\",\n  \"error\": \"Forbidden\"\n}"}

Does anyone see anything obviously wrong with this?

I solved it, and just wanted to post it here in case anyone else using python for their back end runs into this problem.

The ‘exp’ field in the JWT must be an integer.

jwt_payload = {
    'exp': int(time.time() + 60),
    'channel_id': str(user_id),
    'user_id': str(user_id),
    'role': 'external',
    'pubsub_perms': {'send': ['*']}
}