lib/mrkt/concerns/authentication.rb in mrkt-0.10.0 vs lib/mrkt/concerns/authentication.rb in mrkt-0.11.0
- old
+ new
@@ -37,17 +37,29 @@
@scope = data.fetch(:scope)
end
end
def authentication_params
+ merge_params(required_authentication_params, optional_authentication_params)
+ end
+
+ def add_authorization(req)
+ req.headers[:authorization] = "Bearer #{@token}"
+ end
+
+ private
+
+ def optional_authentication_params
{
+ partner_id: @partner_id
+ }
+ end
+
+ def required_authentication_params
+ {
grant_type: 'client_credentials',
client_id: @client_id,
client_secret: @client_secret
}
- end
-
- def add_authorization(req)
- req.headers[:authorization] = "Bearer #{@token}"
end
end
end