Class: Doorkeeper::OAuth::ClientCredentialsRequest

Inherits:
Object
  • Object
show all
Includes:
RequestConcern, Validations
Defined in:
lib/doorkeeper/oauth/client_credentials/issuer.rb,
lib/doorkeeper/oauth/client_credentials_request.rb,
lib/doorkeeper/oauth/client_credentials/creator.rb,
lib/doorkeeper/oauth/client_credentials/validation.rb

Defined Under Namespace

Classes: Creator, Issuer, Validation

Instance Attribute Summary collapse

Attributes included from Validations

#error

Instance Method Summary collapse

Methods included from RequestConcern

#after_successful_response, #authorize, #before_successful_response, #default_scopes, #find_or_create_access_token, #scopes

Methods included from Validations

#validate

Constructor Details

#initialize(server, client, parameters = {}) ⇒ ClientCredentialsRequest

Returns a new instance of ClientCredentialsRequest.


21
22
23
24
25
# File 'lib/doorkeeper/oauth/client_credentials_request.rb', line 21

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

Instance Attribute Details

#clientObject

Returns the value of attribute client


11
12
13
# File 'lib/doorkeeper/oauth/client_credentials_request.rb', line 11

def client
  @client
end

#issuerObject

Returns the value of attribute issuer


11
12
13
# File 'lib/doorkeeper/oauth/client_credentials_request.rb', line 11

def issuer
  @issuer
end

#original_scopesObject

Returns the value of attribute original_scopes


11
12
13
# File 'lib/doorkeeper/oauth/client_credentials_request.rb', line 11

def original_scopes
  @original_scopes
end

#responseObject (readonly) Also known as: error_response

Returns the value of attribute response


12
13
14
# File 'lib/doorkeeper/oauth/client_credentials_request.rb', line 12

def response
  @response
end

#serverObject

Returns the value of attribute server


11
12
13
# File 'lib/doorkeeper/oauth/client_credentials_request.rb', line 11

def server
  @server
end

Instance Method Details

#access_tokenObject


27
28
29
# File 'lib/doorkeeper/oauth/client_credentials_request.rb', line 27

def access_token
  issuer.token
end