Module: Doorkeeper::OAuth::Client::Methods

Included in:
Credentials
Defined in:
lib/doorkeeper/oauth/client/methods.rb

Instance Method Summary collapse

Instance Method Details

#from_basic(request) ⇒ Object



9
10
11
12
13
14
# File 'lib/doorkeeper/oauth/client/methods.rb', line 9

def from_basic(request)
  authorization = request.authorization
  if authorization.present? && authorization =~ /^Basic (.*)/m
    Base64.decode64($1).split(/:/, 2)
  end
end

#from_params(request) ⇒ Object



5
6
7
# File 'lib/doorkeeper/oauth/client/methods.rb', line 5

def from_params(request)
  request.parameters.values_at(:client_id, :client_secret)
end