microsoft-agents-hosting-core 1.6.1.dev3__tar.gz → 1.6.1.dev6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (194) hide show
  1. {microsoft_agents_hosting_core-1.6.1.dev3/microsoft_agents_hosting_core.egg-info → microsoft_agents_hosting_core-1.6.1.dev6}/PKG-INFO +3 -2
  2. microsoft_agents_hosting_core-1.6.1.dev6/VERSION.txt +1 -0
  3. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/oauth/authorization.py +88 -21
  4. microsoft_agents_hosting_core-1.6.1.dev6/microsoft_agents/hosting/core/authorization/_helpers.py +69 -0
  5. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/authorization/access_token_provider_base.py +11 -0
  6. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/authorization/agent_auth_configuration.py +9 -0
  7. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/authorization/anonymous_token_provider.py +12 -0
  8. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6/microsoft_agents_hosting_core.egg-info}/PKG-INFO +3 -2
  9. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents_hosting_core.egg-info/SOURCES.txt +1 -0
  10. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents_hosting_core.egg-info/requires.txt +2 -1
  11. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/setup.py +1 -0
  12. microsoft_agents_hosting_core-1.6.1.dev3/VERSION.txt +0 -1
  13. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/LICENSE +0 -0
  14. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/MANIFEST.in +0 -0
  15. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/__init__.py +0 -0
  16. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/_http_adapter_base.py +0 -0
  17. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/_oauth/__init__.py +0 -0
  18. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/_oauth/_flow_state.py +0 -0
  19. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/_oauth/_flow_storage_client.py +0 -0
  20. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/_oauth/_oauth_flow.py +0 -0
  21. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/_utils/__init__.py +0 -0
  22. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/_utils/_service_set.py +0 -0
  23. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/activity_handler.py +0 -0
  24. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/agent.py +0 -0
  25. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/__init__.py +0 -0
  26. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/_routes/__init__.py +0 -0
  27. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/_routes/_route.py +0 -0
  28. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/_routes/_route_list.py +0 -0
  29. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/_routes/route_rank.py +0 -0
  30. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/_type_defs.py +0 -0
  31. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/adaptive_card/__init__.py +0 -0
  32. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/adaptive_card/_type_defs.py +0 -0
  33. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/adaptive_card/adaptive_card.py +0 -0
  34. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/adaptive_card/factory.py +0 -0
  35. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/adaptive_card/models.py +0 -0
  36. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/agent_application.py +0 -0
  37. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/app_error.py +0 -0
  38. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/app_options.py +0 -0
  39. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/input_file.py +0 -0
  40. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/oauth/__init__.py +0 -0
  41. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/oauth/_handlers/__init__.py +0 -0
  42. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/oauth/_handlers/_authorization_handler.py +0 -0
  43. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/oauth/_handlers/_user_authorization.py +0 -0
  44. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/oauth/_handlers/agentic_user_authorization.py +0 -0
  45. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/oauth/_handlers/connector_user_authorization.py +0 -0
  46. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/oauth/_sign_in_response.py +0 -0
  47. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/oauth/_sign_in_state.py +0 -0
  48. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/oauth/auth_handler.py +0 -0
  49. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/oauth/telemetry/__init__.py +0 -0
  50. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/oauth/telemetry/constants.py +0 -0
  51. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/oauth/telemetry/spans.py +0 -0
  52. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/proactive/__init__.py +0 -0
  53. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/proactive/conversation.py +0 -0
  54. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/proactive/conversation_builder.py +0 -0
  55. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/proactive/conversation_reference_builder.py +0 -0
  56. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/proactive/create_conversation_options.py +0 -0
  57. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/proactive/proactive.py +0 -0
  58. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/proactive/proactive_options.py +0 -0
  59. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/proactive/telemetry/__init__.py +0 -0
  60. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/proactive/telemetry/_utils.py +0 -0
  61. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/proactive/telemetry/constants.py +0 -0
  62. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/proactive/telemetry/spans.py +0 -0
  63. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/query.py +0 -0
  64. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/state/__init__.py +0 -0
  65. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/state/conversation_state.py +0 -0
  66. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/state/state.py +0 -0
  67. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/state/temp_state.py +0 -0
  68. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/state/turn_state.py +0 -0
  69. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/streaming/__init__.py +0 -0
  70. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/streaming/citation.py +0 -0
  71. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/streaming/citation_util.py +0 -0
  72. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/streaming/streaming_response.py +0 -0
  73. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/telemetry/__init__.py +0 -0
  74. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/telemetry/constants.py +0 -0
  75. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/telemetry/metrics.py +0 -0
  76. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/telemetry/spans.py +0 -0
  77. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/app/typing_indicator.py +0 -0
  78. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/authorization/__init__.py +0 -0
  79. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/authorization/_entra_issuers.py +0 -0
  80. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/authorization/_log_config.py +0 -0
  81. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/authorization/auth_types.py +0 -0
  82. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/authorization/authentication_constants.py +0 -0
  83. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/authorization/claims_identity.py +0 -0
  84. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/authorization/connection_manager.py +0 -0
  85. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/authorization/connection_settings_base.py +0 -0
  86. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/authorization/connections.py +0 -0
  87. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/authorization/jwt/__init__.py +0 -0
  88. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/authorization/jwt/_authorize_request.py +0 -0
  89. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/authorization/jwt/jwt_token_validator.py +0 -0
  90. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/authorization/telemetry/__init__.py +0 -0
  91. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/authorization/telemetry/constants.py +0 -0
  92. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/authorization/telemetry/metrics.py +0 -0
  93. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/authorization/telemetry/spans.py +0 -0
  94. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/card_factory.py +0 -0
  95. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/channel_adapter.py +0 -0
  96. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/channel_api_handler_protocol.py +0 -0
  97. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/channel_service_adapter.py +0 -0
  98. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/channel_service_client_factory_base.py +0 -0
  99. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/client/__init__.py +0 -0
  100. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/client/agent_conversation_reference.py +0 -0
  101. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/client/channel_factory_protocol.py +0 -0
  102. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/client/channel_host_protocol.py +0 -0
  103. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/client/channel_info_protocol.py +0 -0
  104. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/client/channel_protocol.py +0 -0
  105. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/client/channels_configuration.py +0 -0
  106. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/client/configuration_channel_host.py +0 -0
  107. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/client/conversation_constants.py +0 -0
  108. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/client/conversation_id_factory.py +0 -0
  109. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/client/conversation_id_factory_options.py +0 -0
  110. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/client/conversation_id_factory_protocol.py +0 -0
  111. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/client/http_agent_channel.py +0 -0
  112. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/client/http_agent_channel_factory.py +0 -0
  113. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/connector/__init__.py +0 -0
  114. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/connector/_utils.py +0 -0
  115. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/connector/agent_sign_in_base.py +0 -0
  116. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/connector/attachments_base.py +0 -0
  117. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/connector/client/__init__.py +0 -0
  118. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/connector/client/_base_client.py +0 -0
  119. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/connector/client/agent_sign_in.py +0 -0
  120. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/connector/client/connector_client.py +0 -0
  121. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/connector/client/user_token.py +0 -0
  122. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/connector/client/user_token_client.py +0 -0
  123. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/connector/connector_client_base.py +0 -0
  124. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/connector/conversations_base.py +0 -0
  125. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/connector/get_product_info.py +0 -0
  126. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/connector/mcs/__init__.py +0 -0
  127. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/connector/mcs/mcs_connector_client.py +0 -0
  128. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/connector/teams/__init__.py +0 -0
  129. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/connector/teams/teams_connector_client.py +0 -0
  130. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/connector/telemetry/__init__.py +0 -0
  131. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/connector/telemetry/_request_span_wrapper.py +0 -0
  132. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/connector/telemetry/connector_spans.py +0 -0
  133. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/connector/telemetry/constants.py +0 -0
  134. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/connector/telemetry/metrics.py +0 -0
  135. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/connector/telemetry/user_token_client_spans.py +0 -0
  136. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/connector/user_token_base.py +0 -0
  137. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/connector/user_token_client_base.py +0 -0
  138. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/errors/__init__.py +0 -0
  139. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/errors/error_resources.py +0 -0
  140. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/header_propagation/__init__.py +0 -0
  141. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/header_propagation/agentic_header_provider.py +0 -0
  142. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/header_propagation/header_propagation_context.py +0 -0
  143. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/header_propagation/header_value_provider.py +0 -0
  144. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/http/__init__.py +0 -0
  145. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/http/_channel_service_routes.py +0 -0
  146. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/http/_http_request_protocol.py +0 -0
  147. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/http/_http_response.py +0 -0
  148. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/message_factory.py +0 -0
  149. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/middleware_set.py +0 -0
  150. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/outbound_host_validator.py +0 -0
  151. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/py.typed +0 -0
  152. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/rest_channel_service_client_factory.py +0 -0
  153. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/state/__init__.py +0 -0
  154. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/state/agent_state.py +0 -0
  155. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/state/state_property_accessor.py +0 -0
  156. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/state/user_state.py +0 -0
  157. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/storage/__init__.py +0 -0
  158. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/storage/_type_aliases.py +0 -0
  159. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/storage/error_handling.py +0 -0
  160. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/storage/memory_storage.py +0 -0
  161. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/storage/storage.py +0 -0
  162. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/storage/store_item.py +0 -0
  163. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/storage/telemetry/__init__.py +0 -0
  164. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/storage/telemetry/constants.py +0 -0
  165. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/storage/telemetry/metrics.py +0 -0
  166. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/storage/telemetry/spans.py +0 -0
  167. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/storage/transcript/__init__.py +0 -0
  168. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/storage/transcript/transcript_file_store.py +0 -0
  169. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/storage/transcript/transcript_info.py +0 -0
  170. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/storage/transcript/transcript_logger.py +0 -0
  171. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/storage/transcript/transcript_memory_store.py +0 -0
  172. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/storage/transcript/transcript_store.py +0 -0
  173. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/telemetry/__init__.py +0 -0
  174. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/telemetry/adapter/__init__.py +0 -0
  175. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/telemetry/adapter/constants.py +0 -0
  176. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/telemetry/adapter/metrics.py +0 -0
  177. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/telemetry/adapter/spans.py +0 -0
  178. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/telemetry/attributes.py +0 -0
  179. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/telemetry/core/__init__.py +0 -0
  180. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/telemetry/core/_agents_telemetry.py +0 -0
  181. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/telemetry/core/base_span_wrapper.py +0 -0
  182. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/telemetry/core/resource.py +0 -0
  183. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/telemetry/core/simple_span_wrapper.py +0 -0
  184. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/telemetry/core/type_defs.py +0 -0
  185. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/telemetry/turn_context/__init__.py +0 -0
  186. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/telemetry/turn_context/constants.py +0 -0
  187. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/telemetry/turn_context/spans.py +0 -0
  188. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/telemetry/utils.py +0 -0
  189. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents/hosting/core/turn_context.py +0 -0
  190. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents_hosting_core.egg-info/dependency_links.txt +0 -0
  191. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/microsoft_agents_hosting_core.egg-info/top_level.txt +0 -0
  192. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/pyproject.toml +0 -0
  193. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/readme.md +0 -0
  194. {microsoft_agents_hosting_core-1.6.1.dev3 → microsoft_agents_hosting_core-1.6.1.dev6}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: microsoft-agents-hosting-core
3
- Version: 1.6.1.dev3
3
+ Version: 1.6.1.dev6
4
4
  Summary: Core library for Microsoft Agents
5
5
  Author: Microsoft Corporation
6
6
  License-Expression: MIT
@@ -15,7 +15,7 @@ Classifier: Operating System :: OS Independent
15
15
  Requires-Python: >=3.10
16
16
  Description-Content-Type: text/markdown
17
17
  License-File: LICENSE
18
- Requires-Dist: microsoft-agents-activity==1.6.1.dev3
18
+ Requires-Dist: microsoft-agents-activity==1.6.1.dev6
19
19
  Requires-Dist: pyjwt>=2.10.1
20
20
  Requires-Dist: isodate>=0.6.1
21
21
  Requires-Dist: python-dotenv>=1.1.1
@@ -23,6 +23,7 @@ Requires-Dist: opentelemetry-api>=1.27.0
23
23
  Requires-Dist: opentelemetry-sdk>=1.27.0
24
24
  Requires-Dist: aiohttp>=3.11.11
25
25
  Requires-Dist: yarl<2.0,>=1.17.0
26
+ Requires-Dist: azure-core
26
27
  Dynamic: license-file
27
28
  Dynamic: requires-dist
28
29
 
@@ -0,0 +1 @@
1
+ 1.6.1.dev6
@@ -7,6 +7,8 @@ import logging
7
7
  from typing import Optional, Callable, Awaitable, cast
8
8
  from dataclasses import dataclass
9
9
 
10
+ from azure.core.credentials_async import AsyncTokenCredential
11
+
10
12
  from microsoft_agents.activity import (
11
13
  Activity,
12
14
  Channels,
@@ -16,6 +18,10 @@ from microsoft_agents.activity import (
16
18
  )
17
19
  from microsoft_agents.activity.activity_types import ActivityTypes
18
20
 
21
+ from microsoft_agents.hosting.core.authorization._helpers import (
22
+ _CallableTokenCredential,
23
+ )
24
+
19
25
  from ...turn_context import TurnContext
20
26
  from ...storage import Storage
21
27
  from ...authorization import Connections
@@ -60,7 +66,7 @@ class Authorization:
60
66
  self,
61
67
  storage: Storage,
62
68
  connection_manager: Connections,
63
- auth_handlers: Optional[dict[str, AuthHandler]] = None,
69
+ auth_handlers: dict[str, AuthHandler] | None = None,
64
70
  auto_sign_in: bool = False,
65
71
  use_cache: bool = False,
66
72
  **kwargs,
@@ -86,10 +92,10 @@ class Authorization:
86
92
  self._connection_manager = connection_manager
87
93
 
88
94
  self._sign_in_success_handler: Optional[
89
- Callable[[TurnContext, TurnState, Optional[str]], Awaitable[None]]
95
+ Callable[[TurnContext, TurnState, str | None], Awaitable[None]]
90
96
  ] = None
91
97
  self._sign_in_failure_handler: Optional[
92
- Callable[[TurnContext, TurnState, Optional[str]], Awaitable[None]]
98
+ Callable[[TurnContext, TurnState, str | None], Awaitable[None]]
93
99
  ] = None
94
100
 
95
101
  self._handlers = {}
@@ -165,13 +171,13 @@ class Authorization:
165
171
  """
166
172
  return f"auth:_SignInState:{context.activity.channel_id}:{context.activity.from_property.id}"
167
173
 
168
- async def _load_sign_in_state(self, context: TurnContext) -> Optional[_SignInState]:
174
+ async def _load_sign_in_state(self, context: TurnContext) -> _SignInState | None:
169
175
  """Load the sign-in state from storage for the given context.
170
176
 
171
177
  :param context: The turn context for the current turn of conversation.
172
178
  :type context: :class:`microsoft_agents.hosting.core.turn_context.TurnContext`
173
179
  :return: The sign-in state if found, None otherwise.
174
- :rtype: Optional[:class:`microsoft_agents.hosting.core.app.oauth._sign_in_state._SignInState`]
180
+ :rtype: :class:`microsoft_agents.hosting.core.app.oauth._sign_in_state._SignInState` | None
175
181
  """
176
182
  key = self._sign_in_state_key(context)
177
183
  return (await self._storage.read([key], target_cls=_SignInState)).get(key)
@@ -205,9 +211,9 @@ class Authorization:
205
211
  @staticmethod
206
212
  def _get_cached_token(
207
213
  context: TurnContext, handler_id: str
208
- ) -> Optional[TokenResponse]:
214
+ ) -> TokenResponse | None:
209
215
  key = Authorization._cache_key(context, handler_id)
210
- return cast(Optional[TokenResponse], context.turn_state.get(key))
216
+ return cast(TokenResponse | None, context.turn_state.get(key))
211
217
 
212
218
  @staticmethod
213
219
  def _cache_token(
@@ -241,7 +247,7 @@ class Authorization:
241
247
  self,
242
248
  context: TurnContext,
243
249
  state: TurnState,
244
- auth_handler_id: Optional[str] = None,
250
+ auth_handler_id: str | None = None,
245
251
  ) -> _SignInResponse:
246
252
  """Start or continue the sign-in process for the user with the given auth handler.
247
253
 
@@ -303,14 +309,14 @@ class Authorization:
303
309
  return sign_in_response
304
310
 
305
311
  async def sign_out(
306
- self, context: TurnContext, auth_handler_id: Optional[str] = None
312
+ self, context: TurnContext, auth_handler_id: str | None = None
307
313
  ) -> None:
308
314
  """Attempts to sign out the user from a specified auth handler or the default handler.
309
315
 
310
316
  :param context: The turn context for the current turn of conversation.
311
317
  :type context: :class:`microsoft_agents.hosting.core.turn_context.TurnContext`
312
318
  :param auth_handler_id: The ID of the auth handler to sign out from. If None, sign out from all handlers.
313
- :type auth_handler_id: Optional[str]
319
+ :type auth_handler_id: str | None
314
320
  :return: None
315
321
  """
316
322
  auth_handler_id = auth_handler_id or self._default_handler_id
@@ -372,7 +378,9 @@ class Authorization:
372
378
  )
373
379
 
374
380
  async def get_token(
375
- self, context: TurnContext, auth_handler_id: Optional[str] = None
381
+ self,
382
+ context: TurnContext,
383
+ auth_handler_id: str | None = None,
376
384
  ) -> TokenResponse:
377
385
  """Gets the token for a specific auth handler or the default handler.
378
386
 
@@ -387,12 +395,34 @@ class Authorization:
387
395
  """
388
396
  return await self.exchange_token(context, auth_handler_id=auth_handler_id)
389
397
 
398
+ def get_token_as_token_credential(
399
+ self,
400
+ context: TurnContext,
401
+ auth_handler_id: str | None = None,
402
+ ) -> AsyncTokenCredential:
403
+ """Gets the token as an AsyncTokenCredential for a specific auth handler or the default handler.
404
+
405
+ :param context: The context object for the current turn.
406
+ :type context: :class:`microsoft_agents.hosting.core.turn_context.TurnContext`
407
+ :param auth_handler_id: The ID of the auth handler to get the token for.
408
+ :type auth_handler_id: str | None
409
+ :return: An AsyncTokenCredential for the specified auth handler or the default handler.
410
+ :rtype: :class:`azure.core.credentials_async.AsyncTokenCredential`
411
+ """
412
+
413
+ async def func(*scopes: str, **_kwargs) -> TokenResponse:
414
+ return await self.exchange_token(
415
+ context, auth_handler_id=auth_handler_id, scopes=list(scopes)
416
+ )
417
+
418
+ return _CallableTokenCredential(func)
419
+
390
420
  async def exchange_token(
391
421
  self,
392
422
  context: TurnContext,
393
- scopes: Optional[list[str]] = None,
394
- auth_handler_id: Optional[str] = None,
395
- exchange_connection: Optional[str] = None,
423
+ scopes: list[str] | None = None,
424
+ auth_handler_id: str | None = None,
425
+ exchange_connection: str | None = None,
396
426
  ) -> TokenResponse:
397
427
  """Exchanges or refreshes the token for a specific auth handler or the default handler.
398
428
 
@@ -400,13 +430,13 @@ class Authorization:
400
430
  :type context: :class:`microsoft_agents.hosting.core.turn_context.TurnContext`
401
431
  :param scopes: The scopes to request during the token exchange or refresh. Defaults
402
432
  to the list given in the AuthHandler configuration if None.
403
- :type scopes: Optional[list[str]]
433
+ :type scopes: list[str] | None
404
434
  :param auth_handler_id: The ID of the auth handler to exchange or refresh the token for.
405
435
  If None, the default handler will be used.
406
- :type auth_handler_id: Optional[str]
436
+ :type auth_handler_id: str | None
407
437
  :param exchange_connection: The name of the connection to use for token exchange. If None,
408
438
  the connection defined in the AuthHandler configuration will be used.
409
- :type exchange_connection: Optional[str]
439
+ :type exchange_connection: str | None
410
440
  :return: The token response from the OAuth provider.
411
441
  :rtype: :class:`microsoft_agents.activity.TokenResponse`
412
442
  :raises ValueError: If the specified auth handler ID is not recognized or not configured.
@@ -441,26 +471,63 @@ class Authorization:
441
471
  return res
442
472
  return TokenResponse()
443
473
 
474
+ def exchange_token_as_token_credential(
475
+ self,
476
+ context: TurnContext,
477
+ scopes: list[str] | None = None,
478
+ auth_handler_id: str | None = None,
479
+ exchange_connection: str | None = None,
480
+ ) -> AsyncTokenCredential:
481
+ """Gets a token credential that exchanges or refreshes the token for a specific auth handler or the default handler.
482
+
483
+ :param context: The context object for the current turn.
484
+ :type context: :class:`microsoft_agents.hosting.core.turn_context.TurnContext`
485
+ :param scopes: The scopes to request during the token exchange or refresh. Defaults
486
+ to the list given in the AuthHandler configuration if None.
487
+ :type scopes: list[str] | None
488
+ :param auth_handler_id: The ID of the auth handler to exchange or refresh the token for.
489
+ If None, the default handler will be used.
490
+ :type auth_handler_id: str | None
491
+ :param exchange_connection: The name of the connection to use for token exchange. If None,
492
+ the connection defined in the AuthHandler configuration will be used.
493
+ :type exchange_connection: str | None
494
+ :return: An instance of `AsyncTokenCredential`.
495
+ :rtype: :class:`azure.core.credentials_async.AsyncTokenCredential`
496
+ :raises ValueError: If the specified auth handler ID is not recognized or not configured.
497
+ """
498
+ scopes = list(scopes) if scopes is not None else []
499
+
500
+ async def func(*new_scopes: str, **_kwargs) -> TokenResponse:
501
+ all_scopes = list(dict.fromkeys([*scopes, *new_scopes]))
502
+ return await self.exchange_token(
503
+ context,
504
+ scopes=all_scopes,
505
+ auth_handler_id=auth_handler_id,
506
+ exchange_connection=exchange_connection,
507
+ )
508
+
509
+ return _CallableTokenCredential(func)
510
+
444
511
  def on_sign_in_success(
445
512
  self,
446
- handler: Callable[[TurnContext, TurnState, Optional[str]], Awaitable[None]],
513
+ handler: Callable[[TurnContext, TurnState, str | None], Awaitable[None]],
447
514
  ) -> None:
448
515
  """
449
516
  Sets a handler to be called when sign-in is successfully completed.
450
517
 
451
518
  :param handler: The handler function to call on successful sign-in.
452
- :type handler: Callable[[:class:`microsoft_agents.hosting.core.turn_context.TurnContext`, :class:`microsoft_agents.hosting.core.app.state.turn_state.TurnState`, Optional[str]], Awaitable[None]]
519
+ :type handler: Callable[[:class:`microsoft_agents.hosting.core.turn_context.TurnContext`, :class:`microsoft_agents.hosting.core.app.state.turn_state.TurnState`, str | None], Awaitable[None]]
453
520
  """
454
521
  self._sign_in_success_handler = handler
455
522
 
456
523
  def on_sign_in_failure(
457
524
  self,
458
- handler: Callable[[TurnContext, TurnState, Optional[str]], Awaitable[None]],
525
+ handler: Callable[[TurnContext, TurnState, str | None], Awaitable[None]],
459
526
  ) -> None:
460
527
  """
461
528
  Sets a handler to be called when sign-in fails.
462
529
 
463
530
  :param handler: The handler function to call on sign-in failure.
464
- :type handler: Callable[[:class:`microsoft_agents.hosting.core.turn_context.TurnContext`, :class:`microsoft_agents.hosting.core.app.state.turn_state.TurnState`, Optional[str]], Awaitable[None]]
531
+ :type handler: Callable[[:class:`microsoft_agents.hosting.core.turn_context.TurnContext`, :class:`microsoft_agents.hosting.core.app.state.turn_state.TurnState`, str | None], Awaitable[None]]
465
532
  """
466
533
  self._sign_in_failure_handler = handler
@@ -0,0 +1,69 @@
1
+ # Copyright (c) Microsoft Corporation. All rights reserved.
2
+ # Licensed under the MIT License.
3
+
4
+ import datetime
5
+ from typing import Protocol
6
+
7
+ from azure.core.credentials_async import AsyncTokenCredential
8
+ from azure.core.credentials import AccessToken
9
+
10
+ from microsoft_agents.activity import TokenResponse
11
+
12
+
13
+ class _TokenRetrieverProtocol(Protocol):
14
+ async def __call__(
15
+ self, *scopes: str, **kwargs
16
+ ) -> TokenResponse | AccessToken | None: ...
17
+
18
+
19
+ def _access_token_from_token_response(token_response: TokenResponse) -> AccessToken:
20
+ """Convert a `TokenResponse` to an `AccessToken`.
21
+
22
+ :param token_response: An instance of `TokenResponse` to convert.
23
+ :return: An instance of `AccessToken`.
24
+ """
25
+ if not token_response:
26
+ raise ValueError("Failed to retrieve token")
27
+
28
+ expires_on = int(
29
+ (
30
+ datetime.datetime.now(datetime.timezone.utc) + datetime.timedelta(minutes=5)
31
+ ).timestamp()
32
+ )
33
+ if token_response.expiration:
34
+ exp = token_response.expiration
35
+ if exp.endswith("Z"):
36
+ exp = exp[:-1] + "+00:00"
37
+ dt = datetime.datetime.fromisoformat(exp)
38
+ if dt.tzinfo is None:
39
+ dt = dt.replace(tzinfo=datetime.timezone.utc)
40
+ else:
41
+ dt = dt.astimezone(datetime.timezone.utc)
42
+ expires_on = int(dt.timestamp())
43
+
44
+ return AccessToken(token=token_response.token, expires_on=expires_on)
45
+
46
+
47
+ class _CallableTokenCredential(AsyncTokenCredential):
48
+ """A wrapper class that implements `AsyncTokenCredential` using a callable to retrieve tokens."""
49
+
50
+ def __init__(self, get_token_callable: _TokenRetrieverProtocol):
51
+ """Initialize the `_CallableTokenCredential` with a token retriever callable.
52
+
53
+ :param get_token_callable: A callable that retrieves tokens.
54
+ """
55
+ self._get_token_callable = get_token_callable
56
+
57
+ async def get_token(self, *scopes: str, **kwargs) -> AccessToken:
58
+ """Get an access token using the provided callable.
59
+
60
+ :param scopes: The scopes for which the access token is requested.
61
+ :param kwargs: Additional keyword arguments to pass to the token retriever callable.
62
+ :return: An instance of `AccessToken`.
63
+ """
64
+ res = await self._get_token_callable(*scopes, **kwargs)
65
+ if not res:
66
+ raise ValueError("Failed to retrieve token")
67
+ if isinstance(res, AccessToken):
68
+ return res
69
+ return _access_token_from_token_response(res)
@@ -4,6 +4,8 @@
4
4
  from typing import Protocol
5
5
  from abc import abstractmethod
6
6
 
7
+ from azure.core.credentials_async import AsyncTokenCredential
8
+
7
9
  from .agent_auth_configuration import AgentAuthConfiguration
8
10
 
9
11
 
@@ -33,6 +35,15 @@ class AccessTokenProviderBase(Protocol):
33
35
  """
34
36
  pass
35
37
 
38
+ @abstractmethod
39
+ def get_token_credential(self) -> AsyncTokenCredential:
40
+ """
41
+ Get the token credential for the access token provider.
42
+
43
+ :return: The token credential.
44
+ """
45
+ pass
46
+
36
47
  async def acquire_token_on_behalf_of(
37
48
  self, scopes: list[str], user_assertion: str
38
49
  ) -> str:
@@ -25,6 +25,7 @@ _RECOGNIZED_CONFIG_KEYS = frozenset(
25
25
  "TENANTID",
26
26
  "CLIENTSECRET",
27
27
  "CERTPFXFILE",
28
+ "SENDX5C",
28
29
  "CONNECTIONNAME",
29
30
  "FEDERATEDCLIENTID",
30
31
  "FEDERATEDTOKENFILE",
@@ -63,6 +64,7 @@ class AgentAuthConfiguration:
63
64
  AUTH_TYPE: The type of authentication to use (microsoft_agents.hosting.core.authorization.auth_types.AuthTypes).
64
65
  CLIENT_SECRET: The client secret for the Azure AD application (if using client secret authentication).
65
66
  CERT_PFX_FILE: The path to the PFX certificate file (if using certificate authentication).
67
+ SEND_X5C: Whether to include the public certificate in the x5c header for certificate authentication.
66
68
  CONNECTION_NAME: The name of the connection
67
69
  FEDERATED_CLIENT_ID: The client ID for federated credentials (if using federated credentials authentication).
68
70
  SCOPES: The scopes to request
@@ -91,6 +93,7 @@ class AgentAuthConfiguration:
91
93
  CLIENT_ID: str | None
92
94
  CLIENT_SECRET: str | None
93
95
  CERT_PFX_FILE: str | None
96
+ SEND_X5C: bool = False
94
97
  CONNECTION_NAME: str | None
95
98
  FEDERATED_CLIENT_ID: str | None
96
99
  SCOPES: list[str] | None
@@ -134,6 +137,7 @@ class AgentAuthConfiguration:
134
137
  issuers: list[str] | None = None,
135
138
  validate_issuer: bool | None = None,
136
139
  federated_token_file: str | None = None,
140
+ send_x5c: bool | None = None,
137
141
  **kwargs: Any,
138
142
  ):
139
143
 
@@ -149,6 +153,11 @@ class AgentAuthConfiguration:
149
153
  self.TENANT_ID = tenant_id or kwargs.get("TENANTID", None)
150
154
  self.CLIENT_SECRET = client_secret or kwargs.get("CLIENTSECRET", None)
151
155
  self.CERT_PFX_FILE = cert_pfx_file or kwargs.get("CERTPFXFILE", None)
156
+ self.SEND_X5C = coerce_bool(
157
+ send_x5c if send_x5c is not None else kwargs.get("SENDX5C", False),
158
+ default=False,
159
+ name="SENDX5C",
160
+ )
152
161
  self.CONNECTION_NAME = connection_name or kwargs.get("CONNECTIONNAME", None)
153
162
  self.FEDERATED_CLIENT_ID = federated_client_id or kwargs.get(
154
163
  "FEDERATEDCLIENTID", None
@@ -3,8 +3,14 @@
3
3
 
4
4
  from typing import Optional
5
5
 
6
+ from azure.core.credentials import AccessToken
7
+ from azure.core.credentials_async import AsyncTokenCredential
8
+
6
9
  from .access_token_provider_base import AccessTokenProviderBase
7
10
  from .agent_auth_configuration import AgentAuthConfiguration
11
+ from ._helpers import _CallableTokenCredential
12
+
13
+ _ANONYMOUS_TOKEN_EXPIRATION = 2**31 - 1
8
14
 
9
15
 
10
16
  class AnonymousTokenProvider(AccessTokenProviderBase):
@@ -26,6 +32,12 @@ class AnonymousTokenProvider(AccessTokenProviderBase):
26
32
  ) -> str:
27
33
  return ""
28
34
 
35
+ def get_token_credential(self) -> AsyncTokenCredential:
36
+ async def get_token(*scopes: str, **kwargs) -> AccessToken:
37
+ return AccessToken("", _ANONYMOUS_TOKEN_EXPIRATION)
38
+
39
+ return _CallableTokenCredential(get_token)
40
+
29
41
  async def acquire_token_on_behalf_of(
30
42
  self, scopes: list[str], user_assertion: str
31
43
  ) -> str:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: microsoft-agents-hosting-core
3
- Version: 1.6.1.dev3
3
+ Version: 1.6.1.dev6
4
4
  Summary: Core library for Microsoft Agents
5
5
  Author: Microsoft Corporation
6
6
  License-Expression: MIT
@@ -15,7 +15,7 @@ Classifier: Operating System :: OS Independent
15
15
  Requires-Python: >=3.10
16
16
  Description-Content-Type: text/markdown
17
17
  License-File: LICENSE
18
- Requires-Dist: microsoft-agents-activity==1.6.1.dev3
18
+ Requires-Dist: microsoft-agents-activity==1.6.1.dev6
19
19
  Requires-Dist: pyjwt>=2.10.1
20
20
  Requires-Dist: isodate>=0.6.1
21
21
  Requires-Dist: python-dotenv>=1.1.1
@@ -23,6 +23,7 @@ Requires-Dist: opentelemetry-api>=1.27.0
23
23
  Requires-Dist: opentelemetry-sdk>=1.27.0
24
24
  Requires-Dist: aiohttp>=3.11.11
25
25
  Requires-Dist: yarl<2.0,>=1.17.0
26
+ Requires-Dist: azure-core
26
27
  Dynamic: license-file
27
28
  Dynamic: requires-dist
28
29
 
@@ -81,6 +81,7 @@ microsoft_agents/hosting/core/app/telemetry/metrics.py
81
81
  microsoft_agents/hosting/core/app/telemetry/spans.py
82
82
  microsoft_agents/hosting/core/authorization/__init__.py
83
83
  microsoft_agents/hosting/core/authorization/_entra_issuers.py
84
+ microsoft_agents/hosting/core/authorization/_helpers.py
84
85
  microsoft_agents/hosting/core/authorization/_log_config.py
85
86
  microsoft_agents/hosting/core/authorization/access_token_provider_base.py
86
87
  microsoft_agents/hosting/core/authorization/agent_auth_configuration.py
@@ -1,4 +1,4 @@
1
- microsoft-agents-activity==1.6.1.dev3
1
+ microsoft-agents-activity==1.6.1.dev6
2
2
  pyjwt>=2.10.1
3
3
  isodate>=0.6.1
4
4
  python-dotenv>=1.1.1
@@ -6,3 +6,4 @@ opentelemetry-api>=1.27.0
6
6
  opentelemetry-sdk>=1.27.0
7
7
  aiohttp>=3.11.11
8
8
  yarl<2.0,>=1.17.0
9
+ azure-core
@@ -20,5 +20,6 @@ setup(
20
20
  "opentelemetry-sdk>=1.27.0",
21
21
  "aiohttp>=3.11.11",
22
22
  "yarl>=1.17.0,<2.0",
23
+ "azure-core",
23
24
  ],
24
25
  )
@@ -1 +0,0 @@
1
- 1.6.1.dev3