Class: Simple::OAuth2::Strategies::Password

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

Overview

Resource Owner Password Credentials strategy class Processes request and respond with Access Token

Class Method Summary collapse

Methods inherited from Base

authenticate_access_grant, authenticate_client, authenticate_resource_owner, authorization_verify_client!, expose_to_bearer_token, token_verify_client!

Class Method Details

.process(request) ⇒ Object

Processes Password request



9
10
11
12
13
14
15
16
# File 'lib/simple_oauth2/strategies/password.rb', line 9

def process(request)
  client = token_verify_client!(request)

  resource_owner = authenticate_resource_owner(client, request) || request.invalid_grant!

  token = config.access_token_class.create_for(client, resource_owner, request.scope.join(','))
  expose_to_bearer_token(token)
end