Class: Simple::OAuth2::Strategies::RefreshToken

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

Overview

Refresh Token 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 Refresh Token request



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/simple_oauth2/strategies/refresh_token.rb', line 9

def process(request)
  client = token_verify_client!(request)
  refresh_token = verify_refresh_token!(request, client.id)

  token = config.access_token_class.create_for(
    client, refresh_token.resource_owner, request.scope.join(',')
  )
  run_callback_on_refresh_token(refresh_token) if config.on_refresh_runnable?

  expose_to_bearer_token(token)
end