Class: Doorkeeper::OAuth::ClientCredentialsRequest
- Inherits:
-
BaseRequest
- Object
- BaseRequest
- Doorkeeper::OAuth::ClientCredentialsRequest
- Defined in:
- lib/doorkeeper/oauth/client_credentials_request.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#original_scopes ⇒ Object
readonly
Returns the value of attribute original_scopes.
-
#parameters ⇒ Object
readonly
Returns the value of attribute parameters.
-
#response ⇒ Object
(also: #error_response)
readonly
Returns the value of attribute response.
Attributes inherited from BaseRequest
Attributes included from Validations
Instance Method Summary collapse
- #access_token ⇒ Object
-
#initialize(server, client, parameters = {}) ⇒ ClientCredentialsRequest
constructor
A new instance of ClientCredentialsRequest.
- #issuer ⇒ Object
Methods inherited from BaseRequest
#after_successful_response, #authorize, #before_successful_response, #find_or_create_access_token, #scopes
Methods included from Validations
Constructor Details
#initialize(server, client, parameters = {}) ⇒ ClientCredentialsRequest
Returns a new instance of ClientCredentialsRequest.
12 13 14 15 16 17 18 |
# File 'lib/doorkeeper/oauth/client_credentials_request.rb', line 12 def initialize(server, client, parameters = {}) @client = client @server = server @response = nil @original_scopes = parameters[:scope] @parameters = parameters.except(:scope) end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
6 7 8 |
# File 'lib/doorkeeper/oauth/client_credentials_request.rb', line 6 def client @client end |
#original_scopes ⇒ Object (readonly)
Returns the value of attribute original_scopes.
6 7 8 |
# File 'lib/doorkeeper/oauth/client_credentials_request.rb', line 6 def original_scopes @original_scopes end |
#parameters ⇒ Object (readonly)
Returns the value of attribute parameters.
6 7 8 |
# File 'lib/doorkeeper/oauth/client_credentials_request.rb', line 6 def parameters @parameters end |
#response ⇒ Object (readonly) Also known as: error_response
Returns the value of attribute response.
6 7 8 |
# File 'lib/doorkeeper/oauth/client_credentials_request.rb', line 6 def response @response end |
Instance Method Details
#access_token ⇒ Object
20 21 22 |
# File 'lib/doorkeeper/oauth/client_credentials_request.rb', line 20 def access_token issuer.token end |
#issuer ⇒ Object
24 25 26 27 28 29 |
# File 'lib/doorkeeper/oauth/client_credentials_request.rb', line 24 def issuer @issuer ||= ClientCredentials::Issuer.new( server, ClientCredentials::Validator.new(server, self), ) end |