Class: Asana::Authentication::TokenAuthentication

Inherits:
Object
  • Object
show all
Defined in:
lib/asana/authentication/token_authentication.rb

Overview

Represents an API token authentication mechanism.

Instance Method Summary collapse

Constructor Details

#initialize(token) ⇒ TokenAuthentication

Returns a new instance of TokenAuthentication.



7
8
9
# File 'lib/asana/authentication/token_authentication.rb', line 7

def initialize(token)
  @token = token
end

Instance Method Details

#configure(connection) ⇒ void

This method returns an undefined value.

Configures a Faraday connection injecting its token as basic auth.

Parameters:

  • builder (Faraday::Connection)

    the Faraday connection instance.



17
18
19
# File 'lib/asana/authentication/token_authentication.rb', line 17

def configure(connection)
  connection.request :authorization, :basic, @token, ''
end