omniauth-zoom-v2 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: f829c24bd3e29b6bc130bd8c5f36d0da2e835f5158256ba7d86b52cb31e18fb1
4
+ data.tar.gz: 86fbfdecf38808418f57401d6b91b053878361f10977aae83be71b3b58229426
5
+ SHA512:
6
+ metadata.gz: 7d53487a9551e7e6674392d3018fab7ab1f694e84095fd9360b0e8c73b8c9de950700de9b338a62b3d4274e07543f4f1ec504c687cddf4aaf99e4f83d444b3f2
7
+ data.tar.gz: f62776cca0dcdd9fbf9d6b873dd9337fe3cd89e7b7fe4818cd4fc81c018281688bd58a56e29e5fd4e14e744e2b1a8a698efc88cc0f6cf78aa68ec59335f6aa7e
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --require spec_helper
2
+ --color
3
+ --format documentation
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ # Changelog
2
+
3
+ ## [0.0.0] - 2025-08-11
4
+
5
+ - Initial release
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2025 Masahiro
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,187 @@
1
+ # OmniauthZoomV2
2
+
3
+ [![License](https://img.shields.io/github/license/cadenza-tech/omniauth-zoom-v2?label=License&labelColor=343B42&color=blue)](https://github.com/cadenza-tech/omniauth-zoom-v2/blob/main/LICENSE.txt) [![Tag](https://img.shields.io/github/tag/cadenza-tech/omniauth-zoom-v2?label=Tag&logo=github&labelColor=343B42&color=2EBC4F)](https://github.com/cadenza-tech/omniauth-zoom-v2/blob/main/CHANGELOG.md) [![Release](https://github.com/cadenza-tech/omniauth-zoom-v2/actions/workflows/release.yml/badge.svg)](https://github.com/cadenza-tech/omniauth-zoom-v2/actions?query=workflow%3Arelease) [![Test](https://github.com/cadenza-tech/omniauth-zoom-v2/actions/workflows/test.yml/badge.svg)](https://github.com/cadenza-tech/omniauth-zoom-v2/actions?query=workflow%3Atest) [![Lint](https://github.com/cadenza-tech/omniauth-zoom-v2/actions/workflows/lint.yml/badge.svg)](https://github.com/cadenza-tech/omniauth-zoom-v2/actions?query=workflow%3Alint)
4
+
5
+ Zoom strategy for OmniAuth.
6
+
7
+ - [Installation](#installation)
8
+ - [Usage](#usage)
9
+ - [Rails Configuration with Devise](#rails-configuration-with-devise)
10
+ - [Configuration Options](#configuration-options)
11
+ - [Auth Hash](#auth-hash)
12
+ - [Changelog](#changelog)
13
+ - [Contributing](#contributing)
14
+ - [License](#license)
15
+ - [Code of Conduct](#code-of-conduct)
16
+ - [Sponsor](#sponsor)
17
+
18
+ ## Installation
19
+
20
+ Install the gem and add to the application's Gemfile by executing:
21
+
22
+ ```bash
23
+ bundle add omniauth-zoom-v2
24
+ ```
25
+
26
+ If bundler is not being used to manage dependencies, install the gem by executing:
27
+
28
+ ```bash
29
+ gem install omniauth-zoom-v2
30
+ ```
31
+
32
+ ## Usage
33
+
34
+ ### Rails Configuration with Devise
35
+
36
+ Add the following to `config/initializers/devise.rb`:
37
+
38
+ ```ruby
39
+ # config/initializers/devise.rb
40
+ Devise.setup do |config|
41
+ config.omniauth :zoom_v2, ENV['ZOOM_CLIENT_ID'], ENV['ZOOM_CLIENT_SECRET']
42
+ end
43
+ ```
44
+
45
+ Add the OmniAuth callbacks routes to `config/routes.rb`:
46
+
47
+ ```ruby
48
+ # config/routes.rb
49
+ Rails.application.routes.draw do
50
+ devise_for :users, controllers: { omniauth_callbacks: 'users/omniauth_callbacks' }
51
+ end
52
+ ```
53
+
54
+ Add the OmniAuth configuration to your Devise model:
55
+
56
+ ```ruby
57
+ class User < ApplicationRecord
58
+ devise :database_authenticatable, :registerable,
59
+ :recoverable, :rememberable, :validatable,
60
+ :omniauthable, omniauth_providers: [:zoom_v2]
61
+ end
62
+ ```
63
+
64
+ ### Configuration Options
65
+
66
+ You can configure several options:
67
+
68
+ ```ruby
69
+ # config/initializers/devise.rb
70
+ Devise.setup do |config|
71
+ config.omniauth :zoom_v2, ENV['ZOOM_CLIENT_ID'], ENV['ZOOM_CLIENT_SECRET'],
72
+ {
73
+ scope: 'user:read:user', # Specify OAuth scopes
74
+ callback_path: '/custom/zoom_v2/callback', # Custom callback path
75
+ }
76
+ end
77
+ ```
78
+
79
+ ### Auth Hash
80
+
81
+ After successful authentication, the auth hash will be available in `request.env['omniauth.auth']`:
82
+
83
+ ```ruby
84
+ {
85
+ provider: 'zoom_v2',
86
+ uid: 'Wk9PTV9VU0VSX0lE',
87
+ info: {
88
+ name: 'Jane Dev',
89
+ nickname: 'Jane Dev',
90
+ email: 'jane.dev@example.com',
91
+ image: 'https://janedev.zoom.us/p/v2/Wk9PTV9QSUNfVVJM/Wk9PTV9QSUNfVVJM',
92
+ location: 'Denver, CO, USA',
93
+ verified: 1,
94
+ urls: {
95
+ zoom: 'https://janedev.zoom.us/j/1234567890?pwd=Wk9PTV9QTUlfUEFTU0NPREU'
96
+ }
97
+ },
98
+ credentials: {
99
+ token: 'bNl4YEFPI/eyJzdiI6IjAwMDAwMiIsImFsZyI6IkhTNTEyIiwidiI6IjIuMCIsImtpZCI6IlpPT01fS0lEIn0',
100
+ expires: true,
101
+ expires_at: 1504169092,
102
+ refresh_token: 'eyJzdiI6IjAwMDAwMiIsImFsZyI6IkhTNTEyIiwidiI6IjIuMCIsImtpZCI6IlpPT01fS0lEIn0'
103
+ },
104
+ extra: {
105
+ raw_info: {
106
+ id: 'Wk9PTV9VU0VSX0lE',
107
+ first_name: 'Jane',
108
+ last_name: 'Dev',
109
+ display_name: 'Jane Dev',
110
+ email: 'jane.dev@example.com',
111
+ type: 2,
112
+ role_name: 'Owner',
113
+ pmi: 1234567890,
114
+ use_pmi: false,
115
+ personal_meeting_url: 'https://janedev.zoom.us/j/1234567890?pwd=Wk9PTV9QTUlfUEFTU0NPREU',
116
+ timezone: 'America/Denver',
117
+ verified: 1,
118
+ dept: '',
119
+ created_at: '2019-04-05T15:24:32Z',
120
+ last_login_time: '2025-03-19T22:42:47Z',
121
+ last_client_version: '6.4.0.51205(mac)',
122
+ pic_url: 'https://janedev.zoom.us/p/v2/Wk9PTV9QSUNfVVJM/Wk9PTV9QSUNfVVJM',
123
+ cms_user_id: '',
124
+ jid: 'Wk9PTV9VU0VSX0lE@xmpp.zoom.us',
125
+ group_ids: [
126
+ 'Wk9PTV9HUk9VUF9JRA'
127
+ ],
128
+ im_group_ids: [
129
+ 'Wk9PTV9HUk9VUF9JRA'
130
+ ],
131
+ account_id: 'Wk9PTV9BQ0NPVU5UX0lE',
132
+ language: 'en-US',
133
+ phone_country: 'US',
134
+ phone_number: '+1 1234567890',
135
+ status: 'active',
136
+ job_title: '',
137
+ cost_center: '',
138
+ company: 'Zoom',
139
+ location: 'Denver, CO, USA',
140
+ custom_attributes: [
141
+ {
142
+ key: 'Wk9PTV9DVVNUT01fQVRUUklCVVRFX0tFWQ',
143
+ name: 'Test',
144
+ value: 'set from API'
145
+ }
146
+ ],
147
+ login_types: [
148
+ 1,
149
+ 100
150
+ ],
151
+ role_id: '0',
152
+ account_number: 12345678,
153
+ cluster: 'aw1',
154
+ phone_numbers: [
155
+ {
156
+ country: 'US',
157
+ code: '+1',
158
+ number: '1234567890',
159
+ verified: false,
160
+ label: ''
161
+ }
162
+ ],
163
+ user_created_at: '2019-04-05T15:23:55Z'
164
+ }
165
+ }
166
+ }
167
+ ```
168
+
169
+ ## Changelog
170
+
171
+ See [CHANGELOG.md](https://github.com/cadenza-tech/omniauth-zoom-v2/blob/main/CHANGELOG.md).
172
+
173
+ ## Contributing
174
+
175
+ Bug reports and pull requests are welcome on GitHub at https://github.com/cadenza-tech/omniauth-zoom-v2. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/cadenza-tech/omniauth-zoom-v2/blob/main/CODE_OF_CONDUCT.md).
176
+
177
+ ## License
178
+
179
+ The gem is available as open source under the terms of the [MIT License](https://github.com/cadenza-tech/omniauth-zoom-v2/blob/main/LICENSE.txt).
180
+
181
+ ## Code of Conduct
182
+
183
+ Everyone interacting in the OmniauthZoomV2 project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/cadenza-tech/omniauth-zoom-v2/blob/main/CODE_OF_CONDUCT.md).
184
+
185
+ ## Sponsor
186
+
187
+ You can sponsor this project on [Patreon](https://patreon.com/CadenzaTech).
data/Rakefile ADDED
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/gem_tasks'
4
+ require 'rspec/core/rake_task'
5
+ require 'rubocop/rake_task'
6
+
7
+ RSpec::Core::RakeTask.new(:spec)
8
+
9
+ RuboCop::RakeTask.new(:rubocop) do |task|
10
+ task.options = ['--format', ENV['RUBOCOP_FORMAT']] if ENV['RUBOCOP_FORMAT']
11
+ end
@@ -0,0 +1,84 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'omniauth-oauth2'
4
+
5
+ module OmniAuth
6
+ module Strategies
7
+ class ZoomV2 < OmniAuth::Strategies::OAuth2
8
+ USER_INFO_URL = 'https://api.zoom.us/v2/users/me'
9
+
10
+ option :name, 'zoom_v2'
11
+
12
+ option :client_options, {
13
+ site: 'https://zoom.us',
14
+ authorize_url: '/oauth/authorize',
15
+ token_url: '/oauth/token'
16
+ }
17
+
18
+ option :authorize_options, [:scope, :state]
19
+
20
+ uid { raw_info['id'] }
21
+
22
+ info do
23
+ prune!({
24
+ name: "#{raw_info['first_name']} #{raw_info['last_name']}".strip,
25
+ first_name: raw_info['first_name'],
26
+ last_name: raw_info['last_name'],
27
+ nickname: raw_info['display_name'],
28
+ email: raw_info['email'],
29
+ image: raw_info['pic_url'],
30
+ location: raw_info['location'],
31
+ verified: raw_info['verified'],
32
+ urls: {
33
+ zoom: raw_info['personal_meeting_url']
34
+ }
35
+ })
36
+ end
37
+
38
+ extra do
39
+ hash = {}
40
+ hash[:raw_info] = raw_info unless skip_info?
41
+ prune!(hash)
42
+ end
43
+
44
+ credentials do
45
+ hash = { token: access_token.token }
46
+ hash[:expires] = access_token.expires?
47
+ hash[:expires_at] = access_token.expires_at if access_token.expires?
48
+ hash[:refresh_token] = access_token.refresh_token if access_token.refresh_token
49
+ hash
50
+ end
51
+
52
+ def raw_info
53
+ @raw_info ||= access_token.get(USER_INFO_URL).parsed
54
+ end
55
+
56
+ def callback_url
57
+ options[:redirect_uri] || (full_host + callback_path)
58
+ end
59
+
60
+ def authorize_params
61
+ super.tap do |params|
62
+ options[:authorize_options].each do |key|
63
+ params[key] = request.params[key.to_s] unless empty?(request.params[key.to_s])
64
+ end
65
+ params[:response_type] = 'code'
66
+ session['omniauth.state'] = params[:state] unless empty?(params[:state])
67
+ end
68
+ end
69
+
70
+ private
71
+
72
+ def prune!(hash)
73
+ hash.delete_if do |_, value|
74
+ prune!(value) if value.is_a?(Hash)
75
+ empty?(value)
76
+ end
77
+ end
78
+
79
+ def empty?(value)
80
+ value.nil? || (value.respond_to?(:empty?) && value.empty?)
81
+ end
82
+ end
83
+ end
84
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OmniAuth
4
+ module ZoomV2
5
+ VERSION = '0.0.0'
6
+ end
7
+ end
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'omniauth/zoom_v2/version'
4
+ require 'omniauth/strategies/zoom_v2'
metadata ADDED
@@ -0,0 +1,83 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: omniauth-zoom-v2
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Masahiro
8
+ bindir: exe
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: omniauth
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - "~>"
17
+ - !ruby/object:Gem::Version
18
+ version: '2.0'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - "~>"
24
+ - !ruby/object:Gem::Version
25
+ version: '2.0'
26
+ - !ruby/object:Gem::Dependency
27
+ name: omniauth-oauth2
28
+ requirement: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - "~>"
31
+ - !ruby/object:Gem::Version
32
+ version: '1.8'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '1.8'
40
+ description: Zoom strategy for OmniAuth
41
+ email:
42
+ - watanabe@cadenza-tech.com
43
+ executables: []
44
+ extensions: []
45
+ extra_rdoc_files: []
46
+ files:
47
+ - ".rspec"
48
+ - CHANGELOG.md
49
+ - LICENSE.txt
50
+ - README.md
51
+ - Rakefile
52
+ - lib/omniauth-zoom-v2.rb
53
+ - lib/omniauth/strategies/zoom_v2.rb
54
+ - lib/omniauth/zoom_v2/version.rb
55
+ homepage: https://github.com/cadenza-tech/omniauth-zoom-v2/tree/v0.0.0
56
+ licenses:
57
+ - MIT
58
+ metadata:
59
+ homepage_uri: https://github.com/cadenza-tech/omniauth-zoom-v2/tree/v0.0.0
60
+ source_code_uri: https://github.com/cadenza-tech/omniauth-zoom-v2/tree/v0.0.0
61
+ changelog_uri: https://github.com/cadenza-tech/omniauth-zoom-v2/blob/v0.0.0/CHANGELOG.md
62
+ bug_tracker_uri: https://github.com/cadenza-tech/omniauth-zoom-v2/issues
63
+ documentation_uri: https://rubydoc.info/gems/omniauth-zoom-v2/0.0.0
64
+ funding_uri: https://patreon.com/CadenzaTech
65
+ rubygems_mfa_required: 'true'
66
+ rdoc_options: []
67
+ require_paths:
68
+ - lib
69
+ required_ruby_version: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: 2.5.0
74
+ required_rubygems_version: !ruby/object:Gem::Requirement
75
+ requirements:
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ version: '0'
79
+ requirements: []
80
+ rubygems_version: 3.6.9
81
+ specification_version: 4
82
+ summary: Zoom strategy for OmniAuth
83
+ test_files: []