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?