8000 Merge pull request #1286 from microsoft/ccastro/sso-teams-cherry-pick · TaffyWrinkle/botbuilder-python@f7eb120 · GitHub
[go: up one dir, main page]

Skip to content

Commit f7eb120

Browse files
authored
Merge pull request microsoft#1286 from microsoft/ccastro/sso-teams-cherry-pick
SSO + Teams cherry pick from 4.9
2 parents 071e7fd + 45efb71 commit f7eb120

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

libraries/botbuilder-dialogs/botbuilder/dialogs/prompts/oauth_prompt.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,9 @@ async def _send_oauth_card(
362362
):
363363
if context.activity.channel_id == Channels.emulator:
364364
card_action_type = ActionTypes.open_url
365-
else:
365+
elif not OAuthPrompt._channel_requires_sign_in_link(
366+
context.activity.channel_id
367+
):
366368
link = None
367369

368370
json_token_ex_resource = (
@@ -546,7 +548,7 @@ async def _recognize_token(
546548
if not token_exchange_response or not token_exchange_response.token:
547549
await context.send_activity(
548550
self._get_token_exchange_invoke_response(
549-
int(HTTPStatus.CONFLICT),
551+
int(HTTPStatus.PRECONDITION_FAILED),
550552
"The bot is unable to exchange token. Proceed with regular login.",
551553
)
552554
)
@@ -609,7 +611,6 @@ def _is_teams_verification_invoke(context: TurnContext) -> bool:
609611
@staticmethod
610612
def _channel_suppports_oauth_card(channel_id: str) -> bool:
611613
if channel_id in [
612-
Channels.ms_teams,
613614
Channels.cortana,
614615
Channels.skype,
615616
Channels.skype_for_business,
@@ -618,6 +619,13 @@ def _channel_suppports_oauth_card(channel_id: str) -> bool:
618619

619620
return True
620621

622+
@staticmethod
623+
def _channel_requires_sign_in_link(channel_id: str) -> bool:
624+
if channel_id in [Channels.ms_teams]:
625+
return True
626+
627+
return False
628+
621629
@staticmethod
622630
def _is_token_exchange_request_invoke(context: TurnContext) -> bool:
623631
activity = context.activity

0 commit comments

Comments
 (0)
0