Class: Zoom::Client::JWT

Inherits:
Zoom::Client show all
Defined in:
lib/zoom/clients/jwt.rb

Constant Summary

Constants included from Actions::Webinar

Actions::Webinar::RECURRENCE_KEYS, Actions::Webinar::SETTINGS_KEYS

Constants included from Actions::Recording

Actions::Recording::RECORDING_SETTINGS_KEYS

Instance Method Summary collapse

Methods inherited from Zoom::Client

#auth_token, #bearer_authorization_header, #headers, #oauth_request_headers, #request_headers

Methods included from Actions

determine_request_options, extract_path_keys, make_request, parse_path

Constructor Details

#initialize(config) ⇒ JWT

Returns a new instance of JWT.



8
9
10
11
12
# File 'lib/zoom/clients/jwt.rb', line 8

def initialize(config)
  Zoom::Params.new(config).require(:api_key, :api_secret)
  config.each { |k, v| instance_variable_set("@#{k}", v) }
  self.class.default_timeout(@timeout || 20)
end

Instance Method Details

#access_tokenObject



14
15
16
# File 'lib/zoom/clients/jwt.rb', line 14

def access_token
  ::JWT.encode({ iss: @api_key, exp: Time.now.to_i + @timeout }, @api_secret, 'HS256', { typ: 'JWT' })
end