@Koala Huynh - You can indeed retrieve the access token silently using Single Sign-On (SSO) in Microsoft Teams, avoiding an additional login prompt. Here's how to do it:
Steps to Implement SSO in Your Bot
Configure Azure AD for SSO:
- Register your bot in the Azure portal.
- Set up the necessary API permissions for Microsoft Graph (e.g.,
ChatMessage.Send
,Chat.ReadWrite
).- Enable the OAuth 2.0 implicit grant flow.
- Set up the necessary API permissions for Microsoft Graph (e.g.,
Implement SSO in Your Bot:
- Utilize the Bot Framework SDK to manage the OAuth flow.
- When the user interacts with the bot, it can silently acquire the token using
OAuthPrompt
andTokenExchangeInvokeRequest
.Ref Docs:
- When the user interacts with the bot, it can silently acquire the token using
- https://learn.microsoft.com/en-us/azure/bot-service/bot-builder-concept-sso?view=azure-bot-service-4.0
- https://learn.microsoft.com/en-us/azure/bot-service/bot-builder-authentication?view=azure-bot-service-4.0&tabs=userassigned%2Caadv2%2Ccsharp
Thanks,
Nivedipa
-----------------------------------------------------------------------------------------------------------
If the response is helpful, please click "Accept Answer" and upvote it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.