botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

Error Running the Sample c# Microsoft.Bot.Sample.AadV2Bot

Open premaarya opened this issue 8 years ago • 11 comments

The Microsoft Bot Framework team prefers that "How To" questions be submitted on Stack Overflow. The official Bot Framework GitHub repository  is the preferred platform for submitting bug fixes and feature requests.

Bot Info

  • SDK Platform: .NET
  • SDK Version: 3.15.3
  • Active Channels: Direct Line, Emulator
  • Deployment Environment: Azure Bot Service, Azure App Service, local development with Emulator.

I am trying the run the ADD V2 sample code with the latest .NET SDK 3.15.3. Followed the V2 configuration provided here the setting provided here succeeds the Test Connection : image

When doing a test in WebChat getting Post error - { "error": { "code": "BadArgument", "message": "Missing token or secret" } }

And emulator error : image

Is this a known issue? How to resolve?

premaarya avatar Jul 27 '18 21:07 premaarya

My ngrok settings are correct After deployment ..i get the auth card when I sign in getting the magic code and the control never returns back to the bot. I get following error on click of SignIn button image

premaarya avatar Jul 30 '18 03:07 premaarya

Can you provide some more information on how you've got your AADv2 OAuth set up? Have you included all the listed permissions as well as "scope"?

Additionally, I'd reccomend testing your OAuth connection via the Settings>"OAuth Connection Setting">[Connection Name]>Test Connection link, as then we can be sure that that side of things is set up.

sbuffkin avatar Jul 30 '18 17:07 sbuffkin

I Tested the connection i get the token successfully. My Scope string is: openid profile Calendars.Read Calendars.Read.Shared Calendars.ReadWrite Contacts.Read Contacts.ReadWrite Files.Read Files.Read.All Files.ReadWrite Files.ReadWrite.All Mail.Read Mail.ReadWrite Mail.ReadWrite Mail.Send User.Read User.Read.All User.ReadWrite User.ReadWrite.All User.ReadBasic.All with and without offline_access then reduced the permissions list to just openid... setting test succeeds but not able to get the flow back from auth flow. Got another thread describing same issue i am facing #71 AND #4745

premaarya avatar Jul 30 '18 21:07 premaarya

If you set up a normal sample bot (a non-auth bot) do you get the same error?

sbuffkin avatar Jul 30 '18 22:07 sbuffkin

Have you made any changes to the sample code?

JasonSowers avatar Aug 01 '18 04:08 JasonSowers

@nyxsys in my bot application the faq before the authdialog working good. I didn't try the sample without Auth, I can try will let you know. @JasonSowers I think I updated the Nuget packages it was not building as I downloaded, also unloaded all other projects. And tried both the emulator versions : Emulator version 4 Preview(above). With the Version 3 I get 401 the moment I hit connect image

premaarya avatar Aug 01 '18 04:08 premaarya

@premaarya can you please try running something like the echobot sample in that solution and see if you get the same result?

JasonSowers avatar Aug 01 '18 15:08 JasonSowers

If you are connecting to azure directly from emulator, please make sure you've set up your AppId and Secret correctly, as the error code you are receiving is generally related to that.

sbuffkin avatar Aug 02 '18 16:08 sbuffkin

Are you still having this problem? We're going to close this issue soon.

sbuffkin avatar Aug 13 '18 15:08 sbuffkin

Closing, please open a new issue if you have this problem again.

sbuffkin avatar Aug 15 '18 17:08 sbuffkin

yes still having the same issue .. when i use the GetAuthenticationDialiog.. Ecobot works fine.

premaarya avatar Aug 15 '18 19:08 premaarya