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

Authorization for Microsoft App ID f196f57b-5b97-4653-aaac-d98824071ed1 failed with status code Unauthorized {Bot Framework V 3.5.1}

Open AnandChitale opened this issue 9 years ago • 14 comments

Authorization for Microsoft App ID f196f57b-5b97-4653-aaac-d98824071ed1 failed with status code Unauthorized {Bot Framework V 3.5.1}

Updated bot builder sdk to V3.5.1 from V3.1.0

at Microsoft.Bot.Connector.JwtTokenRefresher.d__2.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) at Microsoft.Bot.Connector.Conversations.d__8.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Bot.Connector.ConversationsExtensions.d__7.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() at Synechron.MortgageBot.MessagesController.d__0.MoveNext() in C:\Users\Anand.Chitale\MortgageBot\Synechron.MortgageBot\Synechron.MortgageBot\Controllers\MessagesController.cs:line 54

Note : Works fine with version 3.1.0

AnandChitale avatar Feb 01 '17 08:02 AnandChitale

Are you using the new Bot Framework Emulator?

https://docs.botframework.com/en-us/tools/bot-framework-emulator/

willportnoy avatar Feb 01 '17 17:02 willportnoy

@willportnoy my bot throws this error only when it is published but never in the emulator

fercom avatar Feb 01 '17 17:02 fercom

We usually recommend https://docs.botframework.com/en-us/support/troubleshooting-bot-framework-authentication/ for diagnosing authentication issues. I'm not sure the upgrade of the SDK is related, though. If you roll back, does that fix it?

willportnoy avatar Feb 01 '17 22:02 willportnoy

Installing new bot ramework emulator and upgrading to V3.5.1 resolved the issue.Thanks

AnandChitale avatar Feb 02 '17 06:02 AnandChitale

Same problem here after upgrading from 3.2.1 to 3.5.1

When I use ngrok on the server to create a 'tunnel' with ngrok http 80 the authorization issue is gone. But when I'm using the normal server domain, the autorization issue is back. I am testing this live in botframework.com console.

So:

Botframework.com -> ngrok -> Visual Studio Debug = OK Botframework.com -> ngrok -> iis server = OK Botframework.com -> iis server = Unauthorized

Looks like the requests must come from localhost in the new SDK version???? I was also deploying the bot as a web app in azure, but same errors. It used to work fine with 3.2.1

I've spent over 4 hours today to get this to work, but no luck at all.

arnoldpistorius avatar Feb 02 '17 10:02 arnoldpistorius

We found a solution for our network on this problem @willportnoy @AnandChitale @fercom .

Came across an old post on serverfault.com http://serverfault.com/questions/416156/isa-or-iis-removing-http-authorization-header-when-published . In our case it was the TMG server which had Authorization Delegation turned off.

I guess Microsoft started to send requests with an authorization header instead of authorization in the post body since yesterday.

When Authorization Delegation is turned off, the TMG server drops the authorization header.

arnoldpistorius avatar Feb 02 '17 14:02 arnoldpistorius

@arnoldpistorius so, what should we do to correct it?

fercom avatar Feb 02 '17 17:02 fercom

Nothing, it is just a local network configuration issue. Perhaps you can put it in the FAQ.

Op 2 feb. 2017 18:09 schreef "fercom" [email protected]:

@arnoldpistorius https://github.com/arnoldpistorius so, what should we do to correct it?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Microsoft/BotBuilder/issues/2155#issuecomment-277018850, or mute the thread https://github.com/notifications/unsubscribe-auth/AFyny1tNF1r7ceSUNYmpIIqbMIB3onsHks5rYg2tgaJpZM4LzmOX .

arnoldpistorius avatar Feb 02 '17 17:02 arnoldpistorius

@dandriscoll: fyi, @arnoldpistorius found a solution to their 403 issue: https://github.com/Microsoft/BotBuilder/issues/2155#issuecomment-276964664

willportnoy avatar Feb 09 '17 17:02 willportnoy

@willportnoy but @arnoldpistorius says I cannot do anything to solve it

fercom avatar Feb 09 '17 17:02 fercom

@ferom if you have that same issue, you can fix the configuration of your local network's TMG server.

willportnoy avatar Feb 24 '17 04:02 willportnoy

I'm going to close this issue for now, but feel free to open a new issue for further discussion.

willportnoy avatar Feb 28 '17 03:02 willportnoy

Please, stop closing bugs without resolving! You do it not for "resolved bug statistics"? I walking here for many linked bugs and they all closed, but issues is present. V3.5.5

ZOXEXIVO avatar Apr 12 '17 20:04 ZOXEXIVO

This issue was not a bug, but a local firewall/gateway configuration problem. If you are using TMG in your network, you have to allow authorization delegation in order to make the authorization header work.

arnoldpistorius avatar Apr 13 '17 10:04 arnoldpistorius