end_authenticate_user (POST)

Purpose

Finish the web-based user authentication process for a third-party service required by the application.


Input parameters

  • data: A JSON object with the following format:

    {
    "saved_temp_data":"...",
    "service_data":{"token1":"...","token2":"..."}
    }
    

  • saved_temp_data: The data that the matching begin_authenticate_user command returned in the temp_data_to_save element.
  • service_data: All the variables that the authenticating service has passed to the Botize callback in the query string after the authentication process has finished.

Output data

A JSON object with this format:

{
"valid_credentials":"true",
"user_id":"the_user",
"auth_data_to_save":"..."
}


  • valid_credentials: True if the user has been authenticated successfully by the service. If false, the rest of the JSON object is ignored by Botize.
  • user_id: A human-readable identifier for the user that has been authenticated. This value must be unique within the service that has performed the authentication.
  • auth_data_to_save: Any authentication information associated to the authenticated user that the application functions need to work. This data will be passed to the application functions as part of the input data (in the in the authentication/auth_save_data element) when invoked via the process_trigger and do_action commands.

Notes

This command is invoked by Botize after the authenticating service has finished authenticating the user and has invoked the Botize callback provided as part of the input data for the begin_authenticate_user command.

Botize will pass to this command, in the service_data parameter, all the query string variables that the service passed to the Botize callback. Based on this information, the code that implements the command must decide whether the authentication was successful or not, and compose the response JSON object appropriately.

Botize allows the user to authenticate multiple times for the same task; authentication is performed separately for the trigger and the action but both must use the same authentication type and the same authentication service. If more than one authentication has been performed for the same task, the user can select which credentials to use from two lists (one for the trigger and one for the action) available in the task configuration page. The account names displayed in this list are the values returned in the user_id element by this command.

See the User Authentication section for more details.