class Doorkeeper::OAuth::ClientCredentialsRequest

def authorize

def authorize
  status = issuer.create(client, scopes)
  @response = if status
    TokenResponse.new(issuer.token)
  else
    ErrorResponse.from_request(self)
  end
end

def initialize(server, client, parameters = {})

def initialize(server, client, parameters = {})
  @client, @server = client, server
  @response        = nil
  @original_scopes = parameters[:scope]
end

def issuer

def issuer
  @issuer ||= Issuer.new(server, Validation.new(server, self))
end

def scopes

TODO: duplicated code in all flows
def scopes
  @scopes ||= if @original_scopes.present?
    Doorkeeper::OAuth::Scopes.from_string(@original_scopes)
  else
    server.default_scopes
  end
end