Closed Nitin2392 closed 4 years ago
This is related to SDK instead of Web Chat, because it is about the code on the bot side, not browser side.
Thanks @compulim . I've created a Stack Overflow Question to go with this - https://stackoverflow.com/questions/61548711/webchat-oauth-sso-doesnt-continue-with-dialog-flow-after-login
Keeping this issue open just in case someone has a workaround.
Thanks @Nitin2392.
I am also asking the team to transfer this issue to SDK to better surface the question and answers.
Transferring to JS Repo, and will traiage there.
@dmvtech, could you take a look at this?
Thanks @cleemullins
@Nitin2392, can you please test using sample 18.bot-authentication? I just want to narrow down whether the flow is related specifically to login, SSO, or something else.
Presently, I can run sample #18 without issue. I'll next try testing using the blogs you reference and see what results are returned.
Sure @stevkan. I'll try that out and let you know what the results are
If you can check / answer a few more questions, I'd appreciate it:
super(AUTH_DIALOG_ID, AUTH_WATERFALL_DIALOG, [
step => this.promptStep(step),
step => this.loginStep(step)
]);
Have you tried stepping thru slowly with a debugger from the promptStep
to the loginStep
? I ask as I was having the same issue when testing in my development test bot. Yet, when I stepped thru and slowed the login step down the stepContext.result
was populating and getting read by the proceeding if
statement.
That being said, the issue seems to have resolved itself for me on its own. It is now functioning correctly and without pause. Can you double check that this is still an issue for you?
Lastly, (if it isn't a moot point) did sample 18 work when tested?
Closing due to a lack of activity. If the problem persists, please feel free to reopen.
I apologize for not responding @stevkan! We got sidetracked into another project.
So, we figured that we were missing out something and we fixed the issue.
We had to add in this piece of code for things to work
this.onTokenResponseEvent(async (context, next) => {
//Handle token
});
Thanks for your help!
Hey,
The issue we're having right now is that once we click on the
Login
button in the OAuthPrompt from the webchat, the SSO takes over and the Sign in Happens but when the flow returns to the webchat, nothing happens and the bot just hangs.In the Microsoft Bot Framework (v4) bot that we're building, we have implemented the new SSO OAuth features that were recommended in this blog here and here.
1) We initially had an
<iframe>
setup which prompted for the Magic code. 2) We then changed the<iframe>
setup and migrated to a DirectLine channel by changing the webchat's source code to exchange the bot secret for a token (we also pass a unique userId in the format -dl_guid()
) 3) We pass that token down towindow.WebChat.createDirectLine
method sourced from the CDN -https://cdn.botframework.com/botframework-webchat/latest/webchat.js
4) We have AADV2 Setup with the right scopes and we also have the bot configured for this AAD. 5) We also haveEnhanced Authentication options
enabled for the DirectLine channel and have thelocalhost
dev environment & the hosted server environment added to the Trusted Origin list 6) We've also enabled 3rd party cookies in the browserScreenshots
Bot Source Code
Here's a snippet from the AuthDialog that we are using (TypeScript)
If we take a look at the code, the bot should essentially enter into
loginStep
but it doesn't (Tried it by setting breakpoints)Would really appreciate some help with this issue.