Open teal-bauer opened 2 years ago
I'll be cleaning this up as a part of #458 :+1:
Any update on this? Looks like the JWT deprecation has passed and OAuth implementation details are still sparse. Also looks like this PR doesn't include information relating to the differences between client and server-to-server OAuth.
I took a slightly different approach than the README to get the necessary access token:
uri = URI.parse("https://zoom.us/oauth/token")
request = Net::HTTP::Post.new(uri)
# Get client_id, client_secret and account_id from the OAuth dashboard at https://marketplace.zoom.us/user/build
request.basic_auth(client_id, client_secret)
request.set_form_data(
"grant_type" => "account_credentials",
"account_id" => account_id,
)
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
http.request(request)
end
Then this response's access token can be plugged into an OAuth client:
Zoom::Client::OAuth.new(access_token: JSON.parse(response.body)["access_token"])
The README confused me when trying to make an OAuth app work because I didn't realize how to set client_id and client_secret and got opaque errors about
api_key
not being defined.I would suggest two things:
c.client_id = ...
andc.client_secret = ...
work