How i can authenticate a user silently, multi tenant like the the bot of microsoft flow in Teams. This bot not prompt a oauth card and automatically get my flows. How i can get the token of the current session of teams to use for example in graph api?
3 Answers
Per the docs:
Currently, silent authentication only works for tabs. It does not yet work when signing in from a bot.
That being said, if you create a bot that has tabs, the user can click on the tab to silently authenticate. It's not ideal, but for now, that's all there is.
The official Teams Sample Bot does this.
Follow the linked sample and docs to accomplish this. The docs, especially, lay it out pretty well.
OAuth prompt can be used to sign in the user. As of now , the user needs to sign in only once,then when the token expires , the user will be authenticated silently.
Please check out this sample: https://github.com/microsoft/BotBuilder-Samples/tree/master/samples/csharp_dotnetcore/18.bot-authentication
Flow is a first-party app and can bypass tenant-admin consent (like Teams itself, Planner, Assignments, OneNote...).
Currently, SSO is not available for third party apps. Also, silent authentication only works for tabs.