Module: Doorkeeper::OAuth::Token::Methods

Included in:
Doorkeeper::OAuth::Token
Defined in:
lib/doorkeeper/oauth/token.rb

Instance Method Summary collapse

Instance Method Details

#from_access_token_param(request) ⇒ Object


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

def from_access_token_param(request)
  request.parameters[:access_token]
end

#from_basic_authorization(request) ⇒ Object


19
20
21
22
23
# File 'lib/doorkeeper/oauth/token.rb', line 19

def from_basic_authorization(request)
  pattern = /^Basic /
  header  = request.authorization
  token_from_basic_header(header, pattern) if match?(header, pattern)
end

#from_bearer_authorization(request) ⇒ Object


13
14
15
16
17
# File 'lib/doorkeeper/oauth/token.rb', line 13

def from_bearer_authorization(request)
  pattern = /^Bearer /
  header  = request.authorization
  token_from_header(header, pattern) if match?(header, pattern)
end

#from_bearer_param(request) ⇒ Object


9
10
11
# File 'lib/doorkeeper/oauth/token.rb', line 9

def from_bearer_param(request)
  request.parameters[:bearer_token]
end