How to find out the name of the user logged on the machine?

376 Views Asked by At

Is possible find out the name of the user logged on the windows machine on a ChatBot? i am using "userName = context.Activity.From.Name", but it is not need it.

Thanks in advance.

1

There are 1 best solutions below

1
On BEST ANSWER

The bot itself is a server-side web service, so it doesn't have access to the users computer directly except via the various channel clients (Eg. Skype, MS Teams, Slack, etc).

If you need to get user information, you can have the bot users login using their Active Directory (AAD) personal or work account. Once the user is logged in, your bot will have access to user information like name and email.

Overview:

BotAuth it a set of libraries for .NET and Node that simplifies the process of perfoming OAuth and establishing an identity in a project build with the Bot Framework.

You can find an example of the sign-in workflow for bots in the BotAuth repository on GitHub here: https://github.com/richdizz/BotAuth