Sha256: 64a9ff4223e9771b7f8df71709717616309074c1aee43466e955d5164a83bc4b

Contents?: true

Size: 1.09 KB

Versions: 2

Compression:

Stored size: 1.09 KB

Contents

require 'omniauth-oauth2'
module OmniAuth
  module Strategies
    class Webex < OmniAuth::Strategies::OAuth2
      option :name, 'webex'

      option :client_options, {
        authorize_url: 'https://api.ciscospark.com/v1/authorize',
        token_url: 'https://api.ciscospark.com/v1/access_token'
      }

      def authorize_params
        options.authorize_params[:scope] = 'spark-compliance:memberships_read spark:all spark-compliance:memberships_write spark-admin:people_write spark-admin:roles_read spark-admin:organizations_read spark-compliance:events_read spark-compliance:rooms_read spark-compliance:team_memberships_read spark-compliance:messages_write spark:kms spark-compliance:team_memberships_write spark-compliance:teams_read spark-admin:licenses_read spark-compliance:messages_read spark-admin:people_read'
        super
      end

      def build_access_token
        Rails.logger.debug 'Omniauth build access token'
        options.token_params[:headers] = { 'Authorization' => basic_auth_header }
        super
      end

      def basic_auth_header
        'Basic '
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
omniauth-webex-oauth2-0.0.2 lib/omniauth/strategies/webex.rb
omniauth-webex-oauth2-0.0.1 lib/omniauth/strategies/webex.rb