Sha256: ac1a919083c1681f1e59070a4badd144857276f73d1b03335b31ddf6e969087f

Contents?: true

Size: 611 Bytes

Versions: 1

Compression:

Stored size: 611 Bytes

Contents

require 'omniauth-oauth2'

module OmniAuth
  module Strategies
    class RDStation < OmniAuth::Strategies::OAuth2
      option :name, 'rdstation'

      args %i[client_id client_secret]

      option :client_options,
             site: 'https://api.rd.services',
             authorize_url: 'https://api.rd.services/auth/dialog',
             token_url: 'auth/token'

      def request_phase
        auth_url = { redirect_url: callback_url }.merge(authorize_params)
        redirect client.auth_code.authorize_url(auth_url)
      end
    end
  end
end

OmniAuth.config.add_camelization 'rdstation', 'RDStation'

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
omniauth-rdstation-0.1.0 lib/omniauth/strategies/rdstation.rb