Skip to content

bot-teams-authentication Python sample fails after switching from MultiTenant to SingleTenant with CloudAdapter (Unauthorized / 'ErrorResponse' has no attribute 'token') #2237

@Harikrishnan-MSFT

Description

@Harikrishnan-MSFT

Github issues should be used for bugs and feature requests. Use Stack Overflow for general "how-to" questions.

Version

  1. botbuilder-integration-aiohttp>=4.17.0
  2. botbuilder-dialogs>=4.16.2

Describe the bug

While trying to provision the bot-team-authentication sample, we encountered the following error:

Sample Link - https://github.com/OfficeDev/Microsoft-Teams-Samples/tree/main/samples/bot-teams-authentication/python

Image

After updating from MultiTenant to SingleTenant and installing the app, while keeping BotFrameworkAdapter, we started receiving the following error:

icrosoft-SkypeBotApi (Microsoft-BotFramework/3.0)"
INFO:root:Incoming activity type: conversationUpdate
INFO:root:Activity name: None
ERROR:root:Error in on_turn: Operation returned an invalid status code 'Unauthorized'
Traceback (most recent call last):
  File "C:\HariData\August\samples\bot-teams-authentication\python\bots\dialog_bot.py", line 36, in on_turn

After changing the configuration from MultiTenant to SingleTenant, we observed the above errors.
We attempted to resolve the issue by performing the following steps:

  1. Updated the m365agents.local.yml file from MultiTenant to SingleTenant.
  2. Updated BotFrameworkAdapter to CloudAdapter.

After updating to CloudAdapter, we encountered the following error.

Note - These steps work correctly in the non-auth Python sample but fail in the auth sample.

[on_turn_error] unhandled error: 'ErrorResponse' object has no attribute 'token' Traceback (most recent call last): File "c:\Users\username\Downloads\bot-teams-authentication-python\.venv\Lib\site-packages\botbuilder\core\bot_adapter.py", line 174, in run_pipeline return await self._middleware.receive_activity_with_status( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "c:\Users\username\Downloads\bot-teams-authentication-python\.venv\Lib\site-packages\botbuilder\core\middleware_set.py", line 69, in receive_activity_with_status return await self.receive_activity_internal(context, callback) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "c:\Users\username\Downloads\bot-teams-authentication-python\.venv\Lib\site-packages\botbuilder\core\middleware_set.py", line 91, in receive_activity_internal raise error

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or an unintended behavior.needs-triageThe issue has just been created and it has not been reviewed by the team.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions