class OAuth2::Strategy::ClientCredentials

The Client Credentials Strategy

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

Public Instance Methods

authorize_url() click to toggle source

Not used for this strategy

@raise [NotImplementedError]

# File lib/oauth2/strategy/client_credentials.rb, line 10
def authorize_url
  raise(NotImplementedError, 'The authorization endpoint is not used in this strategy')
end
get_token(params = {}, opts = {}) click to toggle source

Retrieve an access token given the specified client.

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

# File lib/oauth2/strategy/client_credentials.rb, line 18
def get_token(params = {}, opts = {})
  params = params.merge('grant_type' => 'client_credentials')
  @client.get_token(params, opts.merge('refresh_token' => nil))
end