Class: Rack::OAuth2::Server::Abstract::Request

Inherits:
Request
  • Object
show all
Includes:
AttrOptional, AttrRequired
Defined in:
lib/rack/oauth2/server/abstract/request.rb

Instance Method Summary collapse

Constructor Details

#initialize(env) ⇒ Request

Returns a new instance of Request.



10
11
12
13
14
# File 'lib/rack/oauth2/server/abstract/request.rb', line 10

def initialize(env)
  super
  @client_id ||= params['client_id']
  @scope = Array(params['scope'].to_s.split(' '))
end

Instance Method Details

#attr_missing!Object



16
17
18
19
20
21
22
23
# File 'lib/rack/oauth2/server/abstract/request.rb', line 16

def attr_missing!
  if params['client_id'].present? && @client_id != params['client_id']
    invalid_request! 'Multiple client credentials are provided.'
  end
  super
rescue AttrRequired::AttrMissing => e
  invalid_request! e.message, state: @state, redirect_uri: @redirect_uri
end