Class: Rack::OAuth2::Server::Token::Request

Inherits:
Abstract::Request show all
Defined in:
lib/rack/oauth2/server/token.rb

Instance Method Summary collapse

Methods inherited from Abstract::Request

#attr_missing_with_error_handling!

Constructor Details

#initialize(env) ⇒ Request

Returns a new instance of Request.



45
46
47
48
49
50
51
52
53
54
55
# File 'lib/rack/oauth2/server/token.rb', line 45

def initialize(env)
  auth = Rack::Auth::Basic::Request.new(env)
  if auth.provided? && auth.basic?
    @client_id, @client_secret = auth.credentials
    super
  else
    super
    @client_secret = params['client_secret']
  end
  @grant_type = params['grant_type'].to_s
end