How to Auth from an external service to the bot framework? - node.js

I have an external service with is own database where the users can log in.
Now I have a bot in NodeJS using Bot Builder and the Bot Framework.
I want to link them.
Is there anyway that the bot recognize the users from the other service everytime they open a new conversation and everytime they write something in the bot?
I've just tried with web chat before and I know that with channels that they support like Facebook, Telegram, Skype etc is easy to recognize the users every time they come back, but I don't know how if it is possible to do this with an external service where the users are already logged in and they want to talk with the chatbot.
I don't know how could I generate an authtoken or something that the bot framework read it and recognize the user.

You can use the DirectLine API to allow your bot and a custom client to communicate to each other, a sample can be found here, and here if you want to use WebSockets.
You can also add authentication to your bot via Azure Bot Service to use OAuth as stated here, where you will find samples too.

Related

Connect slack with simple web api token but not with Slack bot or slack app

As a leisure project, I created a small project that updates slack status whenever an event is added/updated in Google Calendar (Just like the Google calendar app on Slack). Whatever I implemented till now works as expected but I did so by creating a new Slack app, which I don't want to do - In other words, I am trying to integrate Google Calendar with Slack, without any Slack bot or Slack app setup. At least this is what Zapier does - It asks for authentication to Google calendar & Slack, and integrates them without having a Slack bot or Slack app.
I referred to Slack API docs but couldn’t find any page helpful enough to work without a Slack bot or Slack app, and simply with a Web API token.
I think I found a page closer to what I need but this too requires a client ID and client secret which are possible if a new app is created.
It's no longer possible to generate an API token on its own for Slack. If it helps, you can just think of a Slack app as a simple container representing what you want to accomplish. Install the Slack app to get the token and then use the token for that purpose. You don't need to learn or implement OAuth or provide much more than a name to retrieve a token scoped to the activities you wish to accomplish.

Microsoft Bot Framework: How to add Bot to chat via messaging extension?

Let's assume a user chats with another user in a 1:1 chat. (Might also be a group chat.) The user adds a bot and continues to chat while the bot now adds value to the conversation.
We are searching for a way to make adding the bot to a chat as seamless as possible through a simple button click. It seems the closest we can get to a button is using a messaging extension action command.
When the user invokes the messaging extension our backend service runs and can respond e.g. with a card. Now instead of a card is it possible to generate a response to add a bot? There are special responses e.g. for authentication. Is there a response telling the Teams client to add a bot?
Any hints are appreciated.
JIT installation of bot is an option here. You will be able to add bot to user conversation. Check following sample application which helps to add bot instantly: https://github.com/SubbaReddi/89.teams-just-in-time-installation

Send a Google Chat message from a regular account (not a bot)?

I'm trying to send a notification out using Google Chats. But I have a few problems with the documentation I've been able to find:
It requires me to have a paid service account, which I do not have, and will not be getting
It requires using a chat bot, which (in my understanding) needs to be added to a room, and cannot just send out messages
Chat bots can't send out messages directly to personal accounts?
I'm already using Google OAuth2 authentication to access another Google API, so I'd like to use a Google API to send messages directly from the authenticated account. How would I do that?
So far:
All the documentation I can find is about making a chat bot.
I've considered some alternatives to sending out messages, but due to corporate device restrictions that will not be changing, google chats is my best option.
At the moment what you're trying to do is not possible, for multiple reasons.
You may know this already, but Google Chat is an upgrade to their old "Classic Hangouts" chat. In Google's own words, this is focused on enterprise (i.e. paid) accounts. While personal accounts are also able to upgrade and get some of the benefits, their documentation shows that Google Chat for personal accounts is very similar to the old Hangouts and most of the new features are meant for the paid accounts. This also includes the use of bots.
As you've observed, the Chat API currently only has methods to create and manage bots. There are no methods to send messages as your own account. This could be to prevent spam or because their Chat API is relatively new, since the Classic Hangouts did not have an API, and Chat hasn't fully replaced it yet. Even then, given that Chat is "enterprise-focused", it is uncertain whether or not personal accounts would get access to any new API features.
You could try to post feedback on their issue tracker or request the feature to see if you get a response, but for an immediate solution you may want to just use the Gmail API to send a regular email or reconsider the other alternatives that you had in mind.

Microsoft Chat BOT with multiple BOTs integration

I am working on a requirement where we need to create a chat BOT application using Azure BOT service that takes input from the user and based on the response from the user, redirect the user to the chat bot of the particular department.
I would like some suggestions or recommendations on how this can be achieved.
The way to do this is through Bot Framework Skills. You can check for more information on https://learn.microsoft.com/en-us/azure/bot-service/skills-conceptual?view=azure-bot-service-4.0

BotBuilder for Node.js v3 & Microsoft Bot Framework: How do I remotely trigger the start of a new conversation with a user?

If I begin a dialog with a user where in the middle that user is sent a link that they are meant to open, how can I resume the conversation with the user after they have closed the webpage (which I control) the link lead to?
They way I implemented this myself, without using BotBuilder for Node.js v3, was that the link I send to the user has the chatId information associated with it, so when the user later closes the webpage the link leads to, the webpage sends a call to my chat server saying its time to resume the conversation with the specific chatId.
With BotBuilder for Node.js its unclear how I could get it to send a one off message for a specific chatId on a specific channel or begin a new dialog with a user that is triggered by a website or source other than the direct chat recipient. Can someone please give me guidance on this?
For more information on this subject, check out the documentation guide: Integrate your bot with a web browser.
Some scenarios require more than just a bot to fulfill a requirement. A bot may need to send the user to a web browser to complete a task and then resume the conversation with the user after the task has been completed.
Tools covered in this article include:
AuthBot - a .NET library for Azure Active Directory authentication on bots built via Microsoft Bot Framework.
botauth - authentication middleware for bots built using the Bot Framework and Node.js. botauth is leverages passportjs authentication strategies to help bot developers connect to 3rd party oauth providers. You can use botauth to connect your bot's users to their Facebook, Dropbox, or any other API protected by OAuth 2.0.

Resources