If you want to generate a token for a user you need to:

  1. Make a backend workflow and expose it as a public API workflow, this workflow only includes a login action.
  2. Using the API connector make a call for this workflow, this call should be used as an action.
  3. Add this action (the API call) to a workflow and the result of it will be the token.