Hey there,
So I have been using the Headless bot sample for a while now with no issues. I am currently rewriting it to be able to handle bigger meetings, but now I am getting Invalid JWT
half of the time I run the image.
It is not consistent, but around 50% of the times I run docker compose up
I get authentication failed because the JWT is invalid
.
Here is the generateJWT
function:
void Zoom::generateJWT(const string& key, const string& secret) {
m_iat = std::chrono::system_clock::now();
m_exp = m_iat + std::chrono::hours{24};
m_jwt = jwt::create()
.set_type("JWT")
.set_issued_at(m_iat)
.set_expires_at(m_exp)
.set_payload_claim("appKey", claim(key))
.set_payload_claim("tokenExp", claim(m_exp))
.sign(algorithm::hs256{secret});
}
Here is an example of a JWT that is invalid:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBLZXkiOiJRODdJdENUSFIzeVM5ZUtoakd6RXp3IiwiZXhwIjoxNzMwODQ0MDMyLCJpYXQiOjE3MzA3NTc2MzIsInRva2VuRXhwIjoxNzMwODQggpLGU0cz80K5k0fGXBrBMuBkowc0-vjQ
I have tried using both the development and the production ID and secret. I’m not sure if I should share those here.
Thanks,
Noah Schenk