Search code examples
javascriptbotframeworkcortanacortana-skills-kit

How to force Cortana OAuth not to use Magic Code


I used the botbuilder-js to write a custom bot. At some point it requires the user to sign in, so the bot sends out the OAuthPrompt dialog, which makes user sign in (with google, which I have configured in Azure Portal OAuth Connection Settings). It works fine in the Bot Framework Emulator, but when I integrate the bot with Cortana, after the user signs in, he lands on this page:

enter image description here

The fun part is that this dialog is modal, so I cannot paste the code in the Cortana chat even if I wanted to.

What do I need to do to force Cortana to not require this magic code?


Solution

  • Already answered this on the GitHub botbuilder-js repo. Answering for greater visibility.

    It does appear to be a bug. I was able to repro the issue. If you copy the code down you can enter the code as a new command to the bot. It's a terrible work around, but it will work until the UI is fixed. Follow these steps:

    1. Open Cortana and connect to your bot ("tell [bot] hi")
    2. Click login option
    3. Write down magic code from window
    4. Open Cortana and re-connect to your bot
      • Tell your bot the magic code ("tell [bot] [magic code]")
      • Login should succeed
    5. Interact with your bot