Class: Doorkeeper::OAuth::AssertionAccessTokenRequest

Inherits:
Object
  • Object
show all
Includes:
OAuth::Helpers, OAuth::RequestConcern, Validations
Defined in:
lib/doorkeeper/oauth/assertion_access_token_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(server, configuration) ⇒ AssertionAccessTokenRequest

Returns a new instance of AssertionAccessTokenRequest.



22
23
24
25
26
27
# File 'lib/doorkeeper/oauth/assertion_access_token_request.rb', line 22

def initialize(server, configuration)
  @server          = server
  @configuration   = configuration
  @response        = nil
  @original_scopes = server.parameters[:scope]
end

Instance Attribute Details

#access_tokenObject (readonly)

Returns the value of attribute access_token.



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

def access_token
  @access_token
end

#clientObject (readonly)

Returns the value of attribute client.



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

def client
  @client
end

#configurationObject (readonly)

Returns the value of attribute configuration.



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

def configuration
  @configuration
end

#error_descriptionObject (readonly)

Returns the value of attribute error_description.



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

def error_description
  @error_description
end

#original_scopesObject

Returns the value of attribute original_scopes.



10
11
12
# File 'lib/doorkeeper/oauth/assertion_access_token_request.rb', line 10

def original_scopes
  @original_scopes
end

#resource_ownerObject (readonly)

Returns the value of attribute resource_owner.



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

def resource_owner
  @resource_owner
end

#responseObject (readonly)

Returns the value of attribute response.



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

def response
  @response
end

#serverObject

Returns the value of attribute server.



10
11
12
# File 'lib/doorkeeper/oauth/assertion_access_token_request.rb', line 10

def server
  @server
end

Instance Method Details

#authorizeObject



29
30
31
32
33
34
35
36
37
38
# File 'lib/doorkeeper/oauth/assertion_access_token_request.rb', line 29

def authorize
  validate
  if valid?
    @response = TokenResponse.new(access_token)
  else
    @response = DescribableErrorResponse.from_request(self)
    @response.description = error_description
    @response
  end
end