OmniauthZoomV2

License Tag Release Test Lint

Zoom strategy for OmniAuth.

Installation

Install the gem and add to the application's Gemfile by executing:

bundle add omniauth-zoom-v2

If bundler is not being used to manage dependencies, install the gem by executing:

gem install omniauth-zoom-v2

Usage

Rails Configuration with Devise

Add the following to config/initializers/devise.rb:

# config/initializers/devise.rb
Devise.setup do |config|
  config.omniauth :zoom, ENV['ZOOM_CLIENT_ID'], ENV['ZOOM_CLIENT_SECRET']
end

Add the OmniAuth callbacks routes to config/routes.rb:

# config/routes.rb
Rails.application.routes.draw do
  devise_for :users, controllers: { omniauth_callbacks: 'users/omniauth_callbacks' }
end

Add the OmniAuth configuration to your Devise model:

class User < ApplicationRecord
  devise :database_authenticatable, :registerable,
         :recoverable, :rememberable, :validatable,
         :omniauthable, omniauth_providers: [:zoom]
end

Configuration Options

You can configure several options:

# config/initializers/devise.rb
Devise.setup do |config|
  config.omniauth :zoom, ENV['ZOOM_CLIENT_ID'], ENV['ZOOM_CLIENT_SECRET'],
    {
      scope: 'user:read:user', # Specify OAuth scopes
      callback_path: '/custom/zoom/callback', # Custom callback path
    }
end

Auth Hash

After successful authentication, the auth hash will be available in request.env['omniauth.auth']:

{
  provider: 'zoom',
  uid: 'Wk9PTV9VU0VSX0lE',
  info: {
    name: 'Jane Dev',
    nickname: 'Jane Dev',
    email: '[email protected]',
    image: 'https://janedev.zoom.us/p/v2/Wk9PTV9QSUNfVVJM/Wk9PTV9QSUNfVVJM',
    location: 'Denver, CO, USA',
    verified: 1,
    urls: {
      zoom: 'https://janedev.zoom.us/j/1234567890?pwd=Wk9PTV9QTUlfUEFTU0NPREU'
    }
  },
  credentials: {
    token: 'bNl4YEFPI/eyJzdiI6IjAwMDAwMiIsImFsZyI6IkhTNTEyIiwidiI6IjIuMCIsImtpZCI6IlpPT01fS0lEIn0',
    expires: true,
    expires_at: 1504169092,
    refresh_token: 'eyJzdiI6IjAwMDAwMiIsImFsZyI6IkhTNTEyIiwidiI6IjIuMCIsImtpZCI6IlpPT01fS0lEIn0'
  },
  extra: {
    raw_info: {
      id: 'Wk9PTV9VU0VSX0lE',
      first_name: 'Jane',
      last_name: 'Dev',
      display_name: 'Jane Dev',
      email: '[email protected]',
      type: 2,
      role_name: 'Owner',
      pmi: 1234567890,
      use_pmi: false,
      personal_meeting_url: 'https://janedev.zoom.us/j/1234567890?pwd=Wk9PTV9QTUlfUEFTU0NPREU',
      timezone: 'America/Denver',
      verified: 1,
      dept: '',
      created_at: '2019-04-05T15:24:32Z',
      last_login_time: '2025-03-19T22:42:47Z',
      last_client_version: '6.4.0.51205(mac)',
      pic_url: 'https://janedev.zoom.us/p/v2/Wk9PTV9QSUNfVVJM/Wk9PTV9QSUNfVVJM',
      cms_user_id: '',
      jid: '[email protected]',
      group_ids: [
        'Wk9PTV9HUk9VUF9JRA'
      ],
      im_group_ids: [
        'Wk9PTV9HUk9VUF9JRA'
      ],
      account_id: 'Wk9PTV9BQ0NPVU5UX0lE',
      language: 'en-US',
      phone_country: 'US',
      phone_number: '+1 1234567890',
      status: 'active',
      job_title: '',
      cost_center: '',
      company: 'Zoom',
      location: 'Denver, CO, USA',
      custom_attributes: [
        {
          key: 'Wk9PTV9DVVNUT01fQVRUUklCVVRFX0tFWQ',
          name: 'Test',
          value: 'set from API'
        }
      ],
      login_types: [
        1,
        100
      ],
      role_id: '0',
      account_number: 12345678,
      cluster: 'aw1',
      phone_numbers: [
        {
          country: 'US',
          code: '+1',
          number: '1234567890',
          verified: false,
          label: ''
        }
      ],
      user_created_at: '2019-04-05T15:23:55Z'
    }
  }
}

Changelog

See CHANGELOG.md.

Contributing

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.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the OmniauthZoomV2 project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

You can sponsor this project on Patreon.