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.



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

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.



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

def access_token
  @access_token
end

#clientObject (readonly)

Returns the value of attribute client.



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

def client
  @client
end

#configurationObject (readonly)

Returns the value of attribute configuration.



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

def configuration
  @configuration
end

#error_descriptionObject (readonly)

Returns the value of attribute error_description.



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

def error_description
  @error_description
end

#original_scopesObject

Returns the value of attribute original_scopes.



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

def original_scopes
  @original_scopes
end

#resource_ownerObject (readonly)

Returns the value of attribute resource_owner.



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

def resource_owner
  @resource_owner
end

#responseObject (readonly)

Returns the value of attribute response.



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

def response
  @response
end

#serverObject

Returns the value of attribute server.



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

def server
  @server
end

Instance Method Details

#authorizeObject



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

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