Class: OAuth2::Grant::ClientCredentials
- Defined in:
- lib/oauth2/grant/client_credentials.rb
Overview
Client Credentials Grant
Instance Attribute Summary
Attributes inherited from Base
#authorize_path, #client_id, #client_secret, #connection, #device_path, #host, #token_path
Instance Method Summary collapse
-
#get_token(opts = {}) ⇒ Object
Retrieve an access token for the given client credentials.
- #grant_type ⇒ Object
Methods inherited from Base
Methods included from UrlHelper
#build_url, #generate_timestamp, #generate_urlsafe_key, http_basic_encode, #to_query
Constructor Details
This class inherits a constructor from OAuth2::Grant::Base
Instance Method Details
#get_token(opts = {}) ⇒ Object
Retrieve an access token for the given client credentials
18 19 20 21 22 23 24 |
# File 'lib/oauth2/grant/client_credentials.rb', line 18 def get_token(opts={}) opts[:params] ||= {} opts[:params][:grant_type] = grant_type opts[:authenticate] ||= :headers method = opts.delete(:method) || :post make_request(method, @token_path, opts) end |
#grant_type ⇒ Object
10 11 12 |
# File 'lib/oauth2/grant/client_credentials.rb', line 10 def grant_type "client_credentials" end |