Sign in Authentication with Rasa

Hi all, Anyone created sign in authentication on their bot previously? Need to know how can it be done.

Why not use a third party IM client instad? Using Slack/Messenger/Telegram you won’t need to make it yourself.

I want to connect it with my company database. So how can I connect it?

Do you want to login before chatting to the bot? Or verify the user while chatting to the bot?

I want login when user want to use my services like ticket purchase else bot can chat basic conversation without any login.

Then you should do this with custom actions to connect to your database. So ask for details about the user, store it in slots and send it to your database to authenticate the user

Or have a login page first. If login is successful, you can set a sender_id in the user session or something like that.

I already thought that logic but I am unable to store user response and then authenticate it. Actually I made an adaptive card which take username and password from user in input text form and then Action.Submit action execute it but when this card pop up on screen it get executed further without taking response from user that means in Adaptive card data field remains blank which shows undefined in terminal. Can you help me to get response from user?

What do you mean with an adaptive card field?

Adaptive Card field means blank field in adaptive card where user put his/her data.

I’m not entirely sure what this is, but it sounds like you’re trying to get information from the user externally somehow. This is only going to work if you do it within a custom action. I’d suggest just having a login screen before you start the chat with the user, that seems a lot easier

Yeah but I have to add that login screen on my bot. I don’t wanna do sign-in by using external link. I have the database of all my users. Basically I have already built something like login form which has username and password as input data from user but I am unable to take response from user. My exact problem is that when I asked purchase ticket it should provide login form and if login is correct then it should proceed further but in my case it is providing login form but after that without taking user response in username and password it is generating ticket.

Could you post what your custom action looks like here?

It is something like this where “You can purchase your ticket from here” is written It will print the ticket. Currently it is not taking any response from user it is directly printing the ticket

Well it seems that the custom action got executed without actually waiting for user input. This is hard to do within Core though, unless you set slots. Which you probably don’t want to do with passwords

Is there any alternative because user have to login for next action

Hi, I want to do multiple sign in through rasa like for action A payload is X and for action B payload is Y how can I add more than one sign in single custom action. One more thing I want to know that if I take username and password in slots how to push them in payload?

payload of what?

payload for my action which is in the form of json and it is different for both the action A and B.

In the same custom action, see what was the user’s previous message was. Add conditions so that it uses the user_name and password for that particular task. For example, if the user wants to book a bus use the ID and PS for that task using conditions.

As far as I now, you have to just send a text query in the JSON to the bot. The bot is the one to identify it and put it in a slot. What you can do is, create a custom action for this intent and extract the ID and Ps and manually fill the slots.