Class: Simple::OAuth2::Strategies::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/simple_oauth2/strategies/base.rb

Overview

Base Strategies class

Direct Known Subclasses

Password

Class Method Summary collapse

Class Method Details

.authenticate_client(request) ⇒ Object


7
8
9
# File 'lib/simple_oauth2/strategies/base.rb', line 7

def authenticate_client(request)
  config.client_class.authenticate(request.client_id)
end

.authenticate_resource_owner(client, request) ⇒ Object


11
12
13
# File 'lib/simple_oauth2/strategies/base.rb', line 11

def authenticate_resource_owner(client, request)
  config.resource_owner_class.oauth_authenticate(client, request.username, request.password)
end

.expose_to_bearer_token(token) ⇒ Object


15
16
17
# File 'lib/simple_oauth2/strategies/base.rb', line 15

def expose_to_bearer_token(token)
  Rack::OAuth2::AccessToken::Bearer.new(token.to_bearer_token)
end