Class: ExportoAPI::AuthResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/exporto_api/resources/auth_resource.rb

Instance Attribute Summary

Attributes inherited from Resource

#client

Instance Method Summary collapse

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from ExportoAPI::Resource

Instance Method Details

#token(scope: nil) ⇒ Object



5
6
7
8
9
10
# File 'lib/exporto_api/resources/auth_resource.rb', line 5

def token(scope: nil)
  body = {"grant_type" => "client_credentials"}
  body["scope"] = scope unless scope.nil?

  Objects::TokenResponse.new(post_request("auth/token", body: body))
end