-
Notifications
You must be signed in to change notification settings - Fork 479
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
Take magic code detection out of OAuth BeginDialog #1850
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not commenting on the code correctness, as I don't have context.
... but a code change like this needs a corresponding test change. Please add a Unit Test.
|
@cleemullins Tests complete. With new OAuthPrompt: With old OAuthPrompt: |
Pull Request Test Coverage Report for Build 63129
💛 - Coveralls |
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.dll✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.AI.Luis.dll✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.AI.QnA.dll✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.ApplicationInsights.dll✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.Azure.dll✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.Dialogs.dll✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.TemplateManager.dll✔️ No Binary Compatibility issues for Microsoft.Bot.Configuration.dll✔️ No Binary Compatibility issues for Microsoft.Bot.Connector.dll✔️ No Binary Compatibility issues for Microsoft.Bot.Schema.dll |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks right to me. No magic code should be sent on BeginDialog. Thank you!
Note: I believe this actually bring it to parity with JS, since JS doesn't do magic code detection in BeginDialog |
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.dll |
Confirmed: JS SDK does not detect for magic code in
|
Fixes #1596
Also related: https://stackoverflow.com/questions/55970661/ms-bot-framework-doesnt-remember-authentication/55975228#55975228 - this seems like a pretty easy issue to run into.
Issue Summary
OAuthPrompt
has to be called to for certain messages. If that message contains a string that has a 6-digit number,OAuthPrompt
used that number as the magic code, which was invalid, so it re-prompted for Login. The JS SDK doesn't have this issue because it doesn't check for the magic code inbeginDialog()
.
Changes
BeginDialogAsync()
GetUserTokenAsync()
that are unnecessary because of the above change that are handled elsewhereImportant Notes
master
to work well with or without this change. Thesamples-work-in-progress
sample works fine now.OAuthPrompt.GetUserTokenAsync()
. @fuselabs was throwing errors when I attempted to do this, however, since it required adding, string code = null
to theGetUserTokenAsync()
arguments (which would make it match the Node version).Testing
These are using the
samples-work-in-progress
branch:Before
After