lib/omniauth/strategies/cronofy_service_account.rb in omniauth-cronofy-0.8.0 vs lib/omniauth/strategies/cronofy_service_account.rb in omniauth-cronofy-0.9.0
- old
+ new
@@ -1,21 +1,20 @@
module OmniAuth
module Strategies
- class CronofyServiceAccount < OmniAuth::Strategies::OAuth2
+ class CronofyServiceAccount < CronofyBase
option :name, "cronofy_service_account"
option :client_options, {
- :site => ::OmniAuth::Strategies::Cronofy.app_url,
- :authorize_url => "#{::OmniAuth::Strategies::Cronofy.app_url}/enterprise_connect/oauth/authorize",
+ :authorize_url => "/enterprise_connect/oauth/authorize",
}
def request_phase
options[:authorize_params] = { delegated_scope: options[:delegated_scope]} if options[:delegated_scope]
super
end
- uid{ raw_info['sub'] }
+ uid { raw_info['sub'] }
info do
{
:domain => raw_info['cronofy.service_account.domain'],
}
@@ -30,10 +29,10 @@
'raw_info' => raw_info,
}
end
def raw_info
- @raw_info ||= access_token.get("#{::OmniAuth::Strategies::Cronofy.api_url}/v1/userinfo").parsed
+ @raw_info ||= access_token.get("#{client_options[:api_url]}/v1/userinfo").parsed
end
end
end
end