From d4a82b90821950eea273a134cb9fffd9e368ae7c Mon Sep 17 00:00:00 2001 From: Eric Dahlvang Date: Mon, 13 Jan 2020 16:25:59 -0800 Subject: [PATCH] use get_access_token in signed_session, to ensure the Authorization token in the session is not expired --- .../botframework/connector/auth/microsoft_app_credentials.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/botframework-connector/botframework/connector/auth/microsoft_app_credentials.py b/libraries/botframework-connector/botframework/connector/auth/microsoft_app_credentials.py index 291414507..9da4d1d0a 100644 --- a/libraries/botframework-connector/botframework/connector/auth/microsoft_app_credentials.py +++ b/libraries/botframework-connector/botframework/connector/auth/microsoft_app_credentials.py @@ -105,7 +105,7 @@ def signed_session(self, session: requests.Session = None) -> requests.Session: if not self.microsoft_app_id and not self.microsoft_app_password: session.headers.pop("Authorization", None) - elif not session.headers.get("Authorization"): + else: auth_token = self.get_access_token() header = "{} {}".format("Bearer", auth_token) session.headers["Authorization"] = header