Hi! I’m trying to send a message to PubSub using the Developer Rig at the moment.
I’ve been using the Send Extension PubSub Message scheme along with the signed JWT. But still have a 403
Status Code: 403
Body: {
error: 'Forbidden',
status: 403,
message: 'Error (403): JWT could not be verified'
}
This is the token created
const signedPayload = {
"exp": Math.floor(new Date().getTime() / 1000) + 4,
"user_id": payload.user_id,
"role": "external",
"channel_id": payload.channel_id,
"pubsub_perms": {
"send": [
"broadcast"
]
}
}
const token = jsonwebtoken.sign(signedPayload, secret);
Where payload.user_id
and payload.channel_id
are the correct values for the channel I’d like to send the data.
Using the https.request, and passing the options
const options = {
hostname: 'api.twitch.tv',
path: '/helix/extensions/pubsub',
method: 'POST',
headers: {
'Authorization': `Bearer ${token}`,
'Client-Id': clientId,
'Content-Type': 'application/json',
}
};
Also clientId
is the Client ID of the extension, is this correct?
I’ve already checked that the secret is exactly the same as in the Extension Client Configuration. Generated another and retried but it’s not working either.
What’s not working on the process? Thanks!