OAuth emulation presents a blank child window when clicking the authenticate button of the OAuth card
See original GitHub issueVersion
4.2.1
Describe the bug
So I started reporting this bug on the back of the initial issue where the OAuth endpoint was not working at all, but it’s clear now that this needs to be its own bug. The details are as follows:
Clicking the authenticate button of the OAuth card results in a blank child window being popped up which dead ends the entire authentication process making the OAuth emulation unusable.
To Reproduce
Steps to reproduce the behavior:
- Have the bot send out the OAuth card
- Click on the authenticate button in the card
- Stare at the blank child window and wonder what you did wrong 😜
Expected behavior
I would expect the same, default behavior as the v3 emulator which would be to generate an emulated auth token and trigger the TokenResponse
event within the bot with that token. No actual sign in UI need be popped up.
Screenshots
Additional context
Users are also experiencing this as is evidenced by this StackOverflow Question.
[bug]
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:17 (9 by maintainers)
Top Results From Across the Web
oauthCard login opens empty window - Stack Overflow
When I run the bot in bot emulator framework, I see the login button. When I click on it however, it just opens...
Read more >NetSuite Applications Suite - OAuth 2.0 Tasks for Administrators
Manually Creating a Supply Chain Snapshot Simulation ... Blank Value Field for Category Product Mapping in NetSuite Connector · Removing or Resetting Data ......
Read more >OAuth – Asana
Open the developer console (also accessible by clicking on your profile photo in the Asana app, then selecting "My Settings" > Apps >...
Read more >SailPoint IdentityIQ Administration Guide
IdentityIQ supports the use of OAuth 2.0 (client credentials) as a token-based protocol for API authentication. Use this feature to create and manage...
Read more >Embedded Data - Qualtrics
This element shows the page the respondent was on when they clicked the survey link. For most emailed surveys, you will see a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@justinwilaby Thanks for giving me some of your time today. I just want to follow up with what we discovered so the details are here whenever you’re able to return to this issue.
At first, when I attempted to repro this for you, suddenly everything worked as expected. I later determined this was because I was not connected to the network and this must be triggering some behavior to fail which then causes the correct behavior to succeed.
What we determined is that there are two pieces of code responsible for enriching an OAuth card coming from the bot:
oauthLinkEncoder
which is the one that is setting theoauthlink:
protocol and fetching the signin link by calling through thegetUserSignIn
process. This encoder is run as part of thereplyToActivity
middleware.oauthClientEncoder
which is the one that sets theoauth:
protocol and correctly takes theconnectionName
out of the Activity and embeds it in the link. The encoder is run as part of theConversation::processActivity
.When the emulator is online,
#1 - oauthLinkEncoder
always wins. When offline,#2 - oauthClientEncoder
always wins.The expectation is that, in this specific scenario,
#2 - oauthClientEncoder
should always be winning.The root cause has been located thanks to the hard work and persistence from @drub0y. Starting the fix now.