WhyAuthenticated functions allow the change of sensitive data via the chatbot.In combination with variables the bot can know the personalised information of the end-user and perform actions in third-party systems based on the contextual information without asking end-user to enter e.g. last order number, customer Id, email address or other relevant information.Authenticated functions are enabled with the User Authentication setup.How ToTo create an Authenticated function, you need to first create an integration.Go to Admin -> HandoversClick on “Create handover” and choose “User Authentication”Define the details like the URL to your login page and save the handoverOnce this is done, you can create Modules based on this handover.Go to Workspace -> ModulesClick on “Create Module” and choose your handover in the function sectionDefine the Authenticated function and saveThe JWT is accessible as an event parameter and you can attach it to your API calls.import logging
logger = logging.getLogger()
logger.setLevel(logging.INFO)
def handler(event, context):
logger.info('token: %s', event['USER_TOKEN'])
return 'Hello world!'
User FlowIf users reach an Authenticated function in the chatbot, there are two cases:They are not yet logged inThey are already logged in1. Not yet logged inIn this case, the user will see a message and a button that brings them to your login page.Once they are logged you, you can bring them back to the widget and they continue from where they left.2. Already logged inIn this case, the user will directly see the form to execute their actions.