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.



5
6
7
# File 'lib/asana/authentication/token_authentication.rb', line 5

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.



15
16
17
# File 'lib/asana/authentication/token_authentication.rb', line 15

def configure(connection)
  connection.basic_auth(@token, '')
end