class OAuth2Client::Grant::ClientCredentials

Client Credentials Grant

@see tools.ietf.org/html/draft-ietf-oauth-v2-31#section-4.4

Public Instance Methods

get_token(opts={}) click to toggle source

Retrieve an access token for the given client credentials

@param [Hash] params additional params @param [Hash] opts options

# File lib/oauth2-client/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() click to toggle source
# File lib/oauth2-client/grant/client_credentials.rb, line 10
def grant_type 
  "client_credentials"
end