Method: ToopherAPI#authenticate

Defined in:
lib/toopher_api.rb

#authenticate(pairing_id, terminal_name = '', action_name = '', options = {}) ⇒ AuthenticationStatus

Authenticate an action with Toopher

Parameters:

  • pairing_id (String)

    The unique string identifier id returned by a previous pairing request.

  • terminal_name (String) (defaults to: '')

    A human recognizable string which represents the terminal from which the user is making the request. This is displayed to the user on the mobile app when authenticating. If this is not included, then a terminal_id returned from a previous request must be provided (see below). These should be unique values for each different device from which a user connects to your service (as best you can detect).

  • action_name (String) (defaults to: '')

    Optional action name, defaults to “log in” (displayed to the user)

Returns:



87
88
89
90
91
92
93
94
# File 'lib/toopher_api.rb', line 87

def authenticate(pairing_id, terminal_name = '', action_name = '', options = {})
  parameters = {
    'pairing_id' => pairing_id,
    'terminal_name' => terminal_name
  }
  action_name.empty? or (parameters['action_name'] = action_name)
  return AuthenticationStatus.new(post('authentication_requests/initiate', parameters.merge(options)))
end