Class: WhatsAppCloudApi::OAuth2

Inherits:
Object
  • Object
show all
Defined in:
lib/whats_app_cloud_api/http/auth/o_auth2.rb

Overview

Utility class for OAuth 2 authorization and token management.

Class Method Summary collapse

Class Method Details

.apply(config, http_request) ⇒ Object

Add OAuth2 authentication to the http request. be added.

Parameters:

  • The (HttpRequest)

    HttpRequest object to which authentication will



12
13
14
15
# File 'lib/whats_app_cloud_api/http/auth/o_auth2.rb', line 12

def self.apply(config, http_request)
  token = config.access_token
  http_request.headers['Authorization'] = "Bearer #{token}"
end