lib/nexaas_id/client/oauth.rb in nexaas_id-client-0.6.0 vs lib/nexaas_id/client/oauth.rb in nexaas_id-client-0.7.0

- old
+ new

@@ -1,20 +1,20 @@ require 'oauth2' # OAuth2 client used by NexaasID::Client::Application and NexaasID::Client::Identity. # Provides direct access to the underlying OAuth2 API. -class NexaasID::Client::OAuth - - def self.build - config = NexaasID.configuration - OAuth2::Client.new(config.application_token, - config.application_secret, - site: config.url, - connection_opts: { headers: headers }) +class NexaasID::Client::OAuth < OAuth2::Client + def initialize(config) + super( + config.application_token, + config.application_secret, + site: config.url, + connection_opts: { headers: headers } + ) end private - def self.headers + def headers { 'Accept': 'application/json', 'Content-type': 'application/json' } end end