Created
April 1, 2021 13:50
-
-
Save chsh/27f49868aa3a1e8c95ac2a392f4780d1 to your computer and use it in GitHub Desktop.
Zoom Video SDK client signature generator.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'jwt' | |
def generate_instant_token(topic, password: '') | |
sdk_key = ENV['ZOOM_SDK_KEY'] | |
sdk_secret = ENV['ZOOM_SDK_SECRET'] | |
iat = Time.now.to_i | |
exp = iat + 60 * 60 * 2 | |
payload = { | |
app_key: sdk_key, | |
iat: iat, | |
exp: exp, | |
tpc: topic, | |
pwd: password | |
} | |
JWT.encode payload, sdk_secret, | |
'HS256', { typ: 'JWT' } | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment