Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emulator fails to respond to OAuth emulation request #1212

Closed
drub0y opened this issue Jan 7, 2019 · 3 comments · Fixed by #1217
Closed

Emulator fails to respond to OAuth emulation request #1212

drub0y opened this issue Jan 7, 2019 · 3 comments · Fixed by #1217
Assignees
Labels
Bug Your classic code defect

Comments

@drub0y
Copy link

drub0y commented Jan 7, 2019

Version

4.2.146328

Describe the bug

I'm using an OAuthPrompt in my bot to prompt the user to sign in and, during the course of execution, one of the things that obviously does is call out to get the user token to see if they're already authenticated. This HTTP call initiates, but there is never a response and thus the connection hangs until it times out.

Specifically, when I execute my bot if I trace HTTP requests going on I can see all the typical /v3/directly/conversations POST requests going on with the emulator. When I initiate the prompt to attempt to get the user's token I see the following HTTP requests going out from the bot to the emulator:

GET http://localhost:60936/api/usertoken/emulateOAuthCards?emulate=True
GET http://localhost:60936/api/usertoken/GetToken?userId=1c12bf96-a096-405b-8857-05e66eb84abf&connectionName=MyTestConnectionName

The first request succeeds returning a 200, but the second request sends correctly and then never gets a response from the emulator which ultimately results in a client timeout inside the Bot Builder SDK and, long story short, I obviously never get a token or, more importantly, an indication that I haven't yet procured a token.

To Reproduce

Steps to reproduce the behavior:

  1. Write a bot that uses an OAuthPrompt
  2. Begin the OAuthPrompt
  3. Witness that no authentication card is displayed in the emulator and eventually the emulator will timeout and display the "retry" link and if you had opened an HTTP traffic sniffer (such as Fiddler) you will see the /api/usertoken/GetToken request hanging.
  4. Wait a minute or so and an internal exception will occur with a couple minutes deep inside the Bot Builder SDK code's OAuthClient class due to the underlying HTTP request timing out.

Expected behavior

The request to /api/usertoken/GetToken should initially return a 404 status which would then trigger the OAuthPrompt to display its authentication card UI which I can then click to trigger an token to be created within the emulator and then subsequent requests should return an emulated token value from /api/usertoken/GetToken.

Additional context

I should point out that the same code works as expected in the V3 emulator.

[bug]

@justinwilaby justinwilaby added Bug Your classic code defect 4.3 labels Jan 8, 2019
@justinwilaby
Copy link
Contributor

Confirmed repro. Looking into root cause.

@drub0y
Copy link
Author

drub0y commented Jan 18, 2019

Hey team... has this fix shipped? I got an update and figured I'd see if this fix was in and sure enough I now get a response with a 404 on the first /api/token/GetToken call as expected, but now I'm on to a whole new problem which I don't want to file unless it's expected to be working yet.

The short of it is that once I click the OAuth card button in the v4 emulator instead of just sending back the emulated access token, it's popping up a blank child window and dead ending there:

image

Let me know if this is expected to be working now and I'll gladly open a new issue with more details on this next problem.

@drub0y
Copy link
Author

drub0y commented Jan 28, 2019

Ok this is a real issue that other people are experiencing now. I will open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Your classic code defect
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants